Hi,
One line in the class below has me confused.
The line that says:
Test4.this.flag;
I understand that the "this' refers to the current instance of the inner class, but why the need for "Test4"? Can someone help me out on this?
public final class Test4 implements A {
class Inner {
void
test() {
if (Test4.this.flag); {
sample();
}
}
}
private boolean flag = false;
public void sample() {
System.out.println("Sample");
}
public Test4() {
(new Inner()).test();
}
public static void main(
String args []) {
new Test4();
}
}