Accessing the shadowed field from enclosed member class (Java)
Posted
by kolm
on Stack Overflow
See other posts from Stack Overflow
or by kolm
Published on 2010-03-23T13:45:31Z
Indexed on
2010/03/23
13:53 UTC
Read the original article
Hit count: 249
Hi there,
is it possible to access a shadowed field of an enclosing class from the enclosed one in Java?
public class Inherit {
public int a = 3;
private int b = 5;
public class Inheriting {
public int a = 23;
private int d = 8;
public void f() {
System.out.println("Here I want to get a = 3");
...
}
}
}
Cheers!
© Stack Overflow or respective owner