Consider the following program:
public class Outer { private int mem = 10; class Inner { private int imem = new Outer().mem; // ACCESS1 }/*w w w .ja va2 s .c om*/ public static void main(String []s) { System.out.println(new Outer().new Inner().imem); // ACCESS2 } }
Which one of the following options is correct?
c)
An inner class can access even the private members of the outer class.
Similarly, the private variable belonging to the inner class can be accessed in the outer class.