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
πŸ’¬ Discuss
βœ… Correct Answer: (B) 5
Explanation: Here's an explanation of the code:
Explanation by: Rakesh Kumar
Here's an explanation of the code:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
92
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
94%
Success Rate