Which expressions, when inserted at (1), will result in compile-time errors?.
public class Main { static final Integer i1 = 1; final Integer i2 = 2; Integer i3 = 3;// w w w .j ava2 s .co m public static void main(String[] args) { final Integer i4 = 4; Integer i5 = 5; class Inner { final Integer i6 = 6; Integer i7 = 7; Inner (final Integer i8, Integer i9) { System.out.println(/* (1) INSERT EXPRESSION HERE */); } } new Inner(8, 9); } }
Select the three correct answers.
(b), (c), and (e)
(b) and (c) because i2 and i3 are instance fields that cannot be accessed from a static context, in this case from a local class in a static method.
(f) is not allowed because the local variable i5 is not declared final in the enclosing method.