What will be the result of compiling and running the following program?.
public class Main { static final Integer i1 = 1; final Integer i2 = 2; Integer i3 = 3;/*from w ww . java 2s .c o m*/ public static void main(String[] args) { final Integer i4 = 4; Integer i5 = 5; class Inner { final Integer i6 = 6; Integer i7 = 7; Inner () { System.out.print(i6 + i7); } } } }
Select the one correct answer.
(e)
No statement is executed in the main()
method that will print anything.
The print statement in the constructor of the Inner class will only be executed if an object of the Inner class is created in the main()
method.