A

Admin • 830.13K Points
Coach

Q. Determine output:
public class Test{
int a = 10;

public void method(int a){
a += 1;
System.out.println(++a);
}
public static void main(String args[]){
Test t = new Test();
t.method(3);
}
}

  • (A) 4
  • (B) 5
  • (C) 12
  • (D) 12 D. 11
  • Correct Answer - Option(B)
  • Views: 24
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
Here's an explanation of the code:

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.