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

Author Question: Show the output of the following code:public class Test { public static void main(String[] args) ... (Read 70 times)

09madisonrousseau09

  • Hero Member
  • *****
  • Posts: 559
Show the output of the following code:

public class Test {
public static void main(String[] args) {
int[] x = {1, 2, 3, 4, 5};
increase(x);
int[] y = {1, 2, 3, 4, 5};
increase(y[0]);
System.out.println(x[0] + " " + y[0]);
}

public static void increase(int[] x) {
for (int i = 0; i < x.length; i++)
x[i]++;
}

public static void increase(int y) {
y++;
}
}

◦ 0 0
◦ 1 2
◦ 2 2
◦ 1 1
◦ 2 1


Related Topics

Need homework help now?

Ask unlimited questions for free

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

tuwy

  • 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 50% of students answer this correctly




09madisonrousseau09

  • Member
  • Posts: 559
Reply 2 on: May 6, 2020
Great answer, keep it coming :)


Laurenleakan

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

 

Did you know?

Your heart beats over 36 million times a year.

Did you know?

The Centers for Disease Control and Prevention has released reports detailing the deaths of infants (younger than 1 year of age) who died after being given cold and cough medications. This underscores the importance of educating parents that children younger than 2 years of age should never be given over-the-counter cold and cough medications without consulting their physicians.

Did you know?

When Gabriel Fahrenheit invented the first mercury thermometer, he called "zero degrees" the lowest temperature he was able to attain with a mixture of ice and salt. For the upper point of his scale, he used 96°, which he measured as normal human body temperature (we know it to be 98.6° today because of more accurate thermometers).

Did you know?

In Eastern Europe and Russia, interferon is administered intranasally in varied doses for the common cold and influenza. It is claimed that this treatment can lower the risk of infection by as much as 60–70%.

Did you know?

Amphetamine poisoning can cause intravascular coagulation, circulatory collapse, rhabdomyolysis, ischemic colitis, acute psychosis, hyperthermia, respiratory distress syndrome, and pericarditis.

For a complete list of videos, visit our video library