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

Author Question: What is the printout of the following program?public class Test { public static void main(String[] ... (Read 34 times)

Marty

  • Hero Member
  • *****
  • Posts: 553

Question 1

What is the printout of the following program?

public class Test {
public static void main(String[] args) {
int[][] values = {{3, 4, 5, 1}, {33, 6, 1, 2}};
int v = values[0][0];
for (int[] list : values)
for (int element : list)
if (v > element)
v = element;
System.out.print(v);
}
}

◦ 3
◦ 33
◦ 5
◦ 1
◦ 6

Question 2

What is the printout of the following program?

public class Test {
public static void main(String[] args) {
int[][] values = {{3, 4, 5, 1 }, {33, 6, 1, 2}};
for (int row = 0; row < values.length; row++) {
java.util.Arrays.sort(values[row]);
for (int column = 0; column < values[row].length; column++)
System.out.print(values[row][column] + " ");
System.out.println();
}
}
}

◦ The program prints on row 3 4 5 1 33 6 1 2
◦ The program prints two rows 1 3 4 5 followed by 1 2 6 33
◦ The program prints one row 1 3 4 5 1 2 6 33
◦ The program prints two rows 3 4 5 1 followed by 33 6 1 2


Related Topics

Need homework help now?

Ask unlimited questions for free

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

Alyson.hiatt@yahoo.com

  • Sr. Member
  • ****
  • Posts: 354
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




Marty

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


strudel15

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

 

Did you know?

The Centers for Disease Control and Prevention (CDC) was originally known as the Communicable Disease Center, which was formed to fight malaria. It was originally headquartered in Atlanta, Georgia, since the Southern states faced the worst threat from malaria.

Did you know?

As the western states of America were settled, pioneers often had to drink rancid water from ponds and other sources. This often resulted in chronic diarrhea, causing many cases of dehydration and death that could have been avoided if clean water had been available.

Did you know?

Patients who cannot swallow may receive nutrition via a parenteral route—usually, a catheter is inserted through the chest into a large vein going into the heart.

Did you know?

The most destructive flu epidemic of all times in recorded history occurred in 1918, with approximately 20 million deaths worldwide.

Did you know?

There are 20 feet of blood vessels in each square inch of human skin.

For a complete list of videos, visit our video library