This topic contains a solution. Click here to go to the answer

Author Question: What is the output of the following code?public class Test5 { public static void main(String[] args) ... (Read 17 times)

Pea0909berry

  • Hero Member
  • *****
  • Posts: 573

Question 1

What is the output of the following code?

public class Test {
public static void main(String[] args) {
int[][] matrix =
{{1, 2, 3, 4},
{4, 5, 6, 7},
{8, 9, 10, 11},
{12, 13, 14, 15}};
for (int i = 0; i < 4; i++)
System.out.print(matrix[i][1] + " ");
}
}

◦ 1 2 3 4
◦ 2 5 9 13
◦ 4 5 6 7
◦ 3 6 10 14
◦ 1 3 8 12

Question 2

What is the output of the following code?

public class Test5 {
public static void main(String[] args) {
int[][] matrix =
{{1, 2, 3, 4},
{4, 5, 6, 7},
{8, 9, 10, 11},
{12, 13, 14, 15}};
for (int i = 0; i < 4; i++)
System.out.print(matrix[1][i] + " ");
}
}

◦ 2 5 9 13
◦ 3 6 10 14
◦ 1 3 8 12
◦ 4 5 6 7
◦ 1 2 3 4


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by Pea0909berry on May 6, 2020

mcomstock09

  • Sr. Member
  • ****
  • Posts: 377
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




Pea0909berry

  • Member
  • Posts: 573
Reply 2 on: May 6, 2020
Wow, this really help


jamesnevil303

  • Member
  • Posts: 337
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

The word drug comes from the Dutch word droog (meaning "dry"). For centuries, most drugs came from dried plants, hence the name.

Did you know?

Certain chemicals, after ingestion, can be converted by the body into cyanide. Most of these chemicals have been removed from the market, but some old nail polish remover, solvents, and plastics manufacturing solutions can contain these substances.

Did you know?

Cyanide works by making the human body unable to use oxygen.

Did you know?

Pink eye is a term that refers to conjunctivitis, which is inflammation of the thin, clear membrane (conjunctiva) over the white part of the eye (sclera). It may be triggered by a virus, bacteria, or foreign body in the eye. Antibiotic eye drops alleviate bacterial conjunctivitis, and antihistamine allergy pills or eye drops help control allergic conjunctivitis symptoms.

Did you know?

According to animal studies, the typical American diet is damaging to the liver and may result in allergies, low energy, digestive problems, and a lack of ability to detoxify harmful substances.

For a complete list of videos, visit our video library