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 31 times)

jho37

  • Hero Member
  • *****
  • Posts: 531

Question 1

Suppose a method p has the following heading:

public static int[][] p()

What return statement may be used in p()?
◦ return int[]{1, 2, 3};
◦ return new int[][]{{1, 2, 3}, {2, 4, 5}};
◦ return 1;
◦ return {1, 2, 3};
◦ return new int[]{1, 2, 3};

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++) {
System.out.print(m(values[row]) + " ");
}
}

public static int m(int[] list) {
int v = list[0];
for (int i = 1; i < list.length; i++)
if (v < list[i])
v = list[i];
return v;
}
}

◦ 33 5
◦ 5 33
◦ 3 33
◦ 1 1
◦ 5 6


Related Topics

Need homework help now?

Ask unlimited questions for free

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

xthemafja

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




jho37

  • Member
  • Posts: 531
Reply 2 on: May 6, 2020
:D TYSM


hollysheppard095

  • Member
  • Posts: 339
Reply 3 on: Yesterday
Excellent

 

Did you know?

Medication errors are three times higher among children and infants than with adults.

Did you know?

Hippocrates noted that blood separates into four differently colored liquids when removed from the body and examined: a pure red liquid mixed with white liquid material with a yellow-colored froth at the top and a black substance that settles underneath; he named these the four humors (for blood, phlegm, yellow bile, and black bile).

Did you know?

More than 150,000 Americans killed by cardiovascular disease are younger than the age of 65 years.

Did you know?

The first oral chemotherapy drug for colon cancer was approved by FDA in 2001.

Did you know?

Eating food that has been cooked with poppy seeds may cause you to fail a drug screening test, because the seeds contain enough opiate alkaloids to register as a positive.

For a complete list of videos, visit our video library