Given: What is the result?
A.
5
B.
6
C.
An exception is thrown at runtime
D.
Compilation fails due to an error on line 6
E.
Compilation fails due to an error on line 7
Given: What is the result?
A.
5
B.
6
C.
An exception is thrown at runtime
D.
Compilation fails due to an error on line 6
E.
Compilation fails due to an error on line 7
C
line2 have to initialization.
no
Integer should change int
E
C
If Integer changes to int then the result will be 6
C – NullPointerException
C
x is initialized as Null, x+6 will throw NullPointerException