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

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

kodithompson

  • Hero Member
  • *****
  • Posts: 566

Question 1

What is the printout of the following code?

public class Test {
public static void main(String[] args) {
int[][][] data = {{{1, 2}, {3, 4}},
{{5, 6}, {7, 8}}};
System.out.print(data[1][0][0]);
}
}

◦ 1
◦ 2
◦ 4
◦ 5
◦ 6

Question 2

What is the printout of the following code?

public class Test {
public static void main(String[] args) {
int[][][] data = {{{1, 2}, {3, 4}},
{{5, 6}, {7, 8}}};
System.out.print(ttt(data[0]));
}

public static int ttt(int[][] m) {
int v = m[0][0];

for (int i = 0; i < m.length; i++)
for (int j = 0; j < m[i].length; j++)
if (v < m[i][j])
v = m[i][j];

return v;
}
}

◦ 2
◦ 4
◦ 1
◦ 6
◦ 5


Related Topics

Need homework help now?

Ask unlimited questions for free

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

covalentbond

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




kodithompson

  • Member
  • Posts: 566
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


nguyenhoanhat

  • Member
  • Posts: 332
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Alzheimer's disease affects only about 10% of people older than 65 years of age. Most forms of decreased mental function and dementia are caused by disuse (letting the mind get lazy).

Did you know?

Multiple sclerosis is a condition wherein the body's nervous system is weakened by an autoimmune reaction that attacks the myelin sheaths of neurons.

Did you know?

Nitroglycerin is used to alleviate various heart-related conditions, and it is also the chief component of dynamite (but mixed in a solid clay base to stabilize it).

Did you know?

When blood is deoxygenated and flowing back to the heart through the veins, it is dark reddish-blue in color. Blood in the arteries that is oxygenated and flowing out to the body is bright red. Whereas arterial blood comes out in spurts, venous blood flows.

Did you know?

In ancient Rome, many of the richer people in the population had lead-induced gout. The reason for this is unclear. Lead poisoning has also been linked to madness.

For a complete list of videos, visit our video library