How can the static inner class M
and static member M
[of class C
] share the same name?
The following code generates "White" as output:
public class Amazed{
public static void main(String[] args) {
System.out.println(B.M.W);
}
}
class B {
public static class M {
static String W = "Black";
}
static C M = new C();
}
class C {
String W = "White";
}
how the member object is accessed and not the static class member : W ["Black"]
if i want to access the member within static class M how to do that?