Sail E0 Webinar
Question
What 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 ) ;
}
}
Options:
A .  20
B .  21
C .  22
D .  Compilation Error
E .  Throws Exception
Answer: Option C

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers