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 29 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


milbourne11

  • Member
  • Posts: 322
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Stevens-Johnson syndrome and Toxic Epidermal Necrolysis syndrome are life-threatening reactions that can result in death. Complications include permanent blindness, dry-eye syndrome, lung damage, photophobia, asthma, chronic obstructive pulmonary disease, permanent loss of nail beds, scarring of mucous membranes, arthritis, and chronic fatigue syndrome. Many patients' pores scar shut, causing them to retain heat.

Did you know?

Most strokes are caused when blood clots move to a blood vessel in the brain and block blood flow to that area. Thrombolytic therapy can be used to dissolve the clot quickly. If given within 3 hours of the first stroke symptoms, this therapy can help limit stroke damage and disability.

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?

Throughout history, plants containing cardiac steroids have been used as heart drugs and as poisons (e.g., in arrows used in combat), emetics, and diuretics.

Did you know?

Vaccines cause herd immunity. If the majority of people in a community have been vaccinated against a disease, an unvaccinated person is less likely to get the disease since others are less likely to become sick from it and spread the disease.

For a complete list of videos, visit our video library