msketchy msketchy
  • 17-12-2017
  • Computers and Technology
contestada

What is output by the following code?

public static void stuff(int w) {
w -= 2;
}

public static void main(String a[]) {
int n = 2;
stuff(n);
System.out.print(n);
}


1. 0
2. 4
3. 1
4. 3
5. 2

Respuesta :

tonb
tonb tonb
  • 18-12-2017
The output is 2. The stuff() function receives a copy of n, changes it but the result is never used.
Answer Link

Otras preguntas

Help! Asap! Explain why dividing by a fraction results in the same answer as multiplying by its reciprocal.
27. What volume of 5.00 M HNO3(aq) must be diluted to prepare 50.0 mL of 1.25 M HNO3(aq) solution?
Can someone plz help me Ian needs to find the area of the shaded region shown below. Which statements can he use to find the answer? Select three options. A cir
Math question 5! Thanks if you help
6.9 is how many kilometers
The personality test Teresa is taking involves her describing random patterns of dots. What type of test is she taking?
As the temperature of the gas in a balloon decreases which occurs after
What country was bernardo de galvez from?
what is climate conditioning​
All of the following statements were part of the original cell theory proposed by Schleiden and Schwann, and many others including Remak and Virchow, with the E