|
|
@ -23,12 +23,22 @@ public class InnerClass |
|
|
|
{ |
|
|
|
{ |
|
|
|
private int x; |
|
|
|
private int x; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Parent |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int a = 1; |
|
|
|
|
|
|
|
protected int x; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ambiguous() { |
|
|
|
|
|
|
|
System.err.println("Parent"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class Inner |
|
|
|
class Inner |
|
|
|
{ |
|
|
|
{ |
|
|
|
int a = 4; |
|
|
|
int a = 4; |
|
|
|
private int b = x; |
|
|
|
private int b = x; |
|
|
|
|
|
|
|
|
|
|
|
class InnerInner |
|
|
|
class InnerInner extends Parent |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
public int getB() { |
|
|
|
public int getB() { |
|
|
@ -41,11 +51,20 @@ public class InnerClass |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public InnerInner(int c) { |
|
|
|
public InnerInner(int c) { |
|
|
|
x = c; |
|
|
|
this.x = c; |
|
|
|
a = b; |
|
|
|
InnerClass.this.x = b; |
|
|
|
|
|
|
|
this.a = b; |
|
|
|
|
|
|
|
Inner.this.a = c; |
|
|
|
|
|
|
|
this.ambiguous(); |
|
|
|
|
|
|
|
Inner.this.ambiguous(); |
|
|
|
|
|
|
|
InnerClass.this.ambiguous(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ambiguous() { |
|
|
|
|
|
|
|
System.err.println("Inner"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int getB() { |
|
|
|
private int getB() { |
|
|
|
return b; |
|
|
|
return b; |
|
|
|
} |
|
|
|
} |
|
|
@ -61,9 +80,15 @@ public class InnerClass |
|
|
|
|
|
|
|
|
|
|
|
Extended(Inner inner) { |
|
|
|
Extended(Inner inner) { |
|
|
|
inner.super(3); |
|
|
|
inner.super(3); |
|
|
|
|
|
|
|
this.ambiguous(); |
|
|
|
|
|
|
|
InnerClass.this.ambiguous(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ambiguous() { |
|
|
|
|
|
|
|
System.err.println("InnerClass"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Inner createInner(InnerClass outer) { |
|
|
|
private static Inner createInner(InnerClass outer) { |
|
|
|
return outer.new Inner(); |
|
|
|
return outer.new Inner(); |
|
|
|
} |
|
|
|
} |
|
|
|