Single Choice Not Set

QWhat is the output of the following program?
public class Test{
	static int x  = 10 ;
       	public static void main(String[] a){
		 Test test = new Test( ) ; 
		 Test test1 = new Test( ) ;
		 test.x  +=  1 ;
		 System.out.println(  test.x + test1.x ) ;    
	}
}

ID: #2014 Java Data Types and Variables - MCQ 1,070 views
Question Info
#2014Q ID
Not SetDifficulty
Java Data Types and Variables - MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 20
  • B 21
  • C 22
  • D Compilation Error
Correct Answer

Explanation

22

Share This Question

Challenge a friend or share with your study group.