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 27 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
Gracias!


JCABRERA33

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

 

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

The Romans did not use numerals to indicate fractions but instead used words to indicate parts of a whole.

Did you know?

Disorders that may affect pharmacodynamics include genetic mutations, malnutrition, thyrotoxicosis, myasthenia gravis, Parkinson's disease, and certain forms of insulin-resistant diabetes mellitus.

Did you know?

The first war in which wide-scale use of anesthetics occurred was the Civil War, and 80% of all wounds were in the extremities.

Did you know?

Always store hazardous household chemicals in their original containers out of reach of children. These include bleach, paint, strippers and products containing turpentine, garden chemicals, oven cleaners, fondue fuels, nail polish, and nail polish remover.

For a complete list of videos, visit our video library