Consider the following case:
public class A {
public A() { b = new B(); }
B b;
private class B { }
}
From a warning in Eclipse I quote that: the java complier emulates the constructor A.B() by a synthetic accessor method. I suppose the compiler now goes ahead and creates an extra "under water" constructor for B.
I feel this is rather strange: why would class B not be visible as a.k.o. field in A? And: does it mean that class B is no longer private at run time? And: why behaves the protected keyword for class B different?
public class A {
public A() { b = new B(); }
B b;
protected class B { }
}