class Outer { private String name = "Hello"; class Inner { public void print() { System.out.println(Outer.this.name); } } public void fun() { new Inner().print(); } }
public class OODemo {
/** * @param args */ public static void main(String[] args) { new Outer().fun(); }
class Outer { private String name = "Hello"; public void fun() { class Inner { public void print() { System.out.println(Outer.this.name); } } new Inner().print(); }
}
public class OODemo {
/** * @param args */ public static void main(String[] args) { new Outer().fun(); }
class Outer { private String name = "Hello"; public void fun(final int x) { final String str = "MLDN"; class Inner { public void print() { System.out.println(Outer.this.name); System.out.println(x); System.out.println(str); } } new Inner().print(); }
}
public class OODemo {
/** * @param args */ public static void main(String[] args) { new Outer().fun(10); }