public class InnerClassThis { int x=10; public void foo() { System.out.println("Outer class"); } public class ReallyInner { public void foo() { System.out.println("Inner class"); } public void test() { this.foo(); InnerClassThis.this.foo(); } } public static void main(String... args) { InnerClassThis.ReallyInner i = new InnerClassThis().new ReallyInner(); i.test(); } }
int x=10;
public void foo() {
System.out.println("Outer class");
}
public class ReallyInner {
System.out.println("Inner class");
public void test() {
this.foo();
InnerClassThis.this.foo();
public static void main(String... args) {
InnerClassThis.ReallyInner i = new InnerClassThis().new ReallyInner();
i.test();
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.