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 36 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
Excellent


bassamabas

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

 

Did you know?

About one in five American adults and teenagers have had a genital herpes infection—and most of them don't know it. People with genital herpes have at least twice the risk of becoming infected with HIV if exposed to it than those people who do not have genital herpes.

Did you know?

Looking at the sun may not only cause headache and distort your vision temporarily, but it can also cause permanent eye damage. Any exposure to sunlight adds to the cumulative effects of ultraviolet (UV) radiation on your eyes. UV exposure has been linked to eye disorders such as macular degeneration, solar retinitis, and corneal dystrophies.

Did you know?

This year, an estimated 1.4 million Americans will have a new or recurrent heart attack.

Did you know?

In 1835 it was discovered that a disease of silkworms known as muscardine could be transferred from one silkworm to another, and was caused by a fungus.

Did you know?

Today, nearly 8 out of 10 pregnant women living with HIV (about 1.1 million), receive antiretrovirals.

For a complete list of videos, visit our video library