I read that if constructor is public then you need a static method to create the object of that class.
But in the following scenario why I am able to get the object of PrivateStuff whereas it has private constructor.
I am messing with this concept.
public class Test {
public static void main(String[] args) {
Test t = new Test();
PrivateStuff p = t.new PrivateStuff();
}
private class PrivateStuff{
private PrivateStuff(){
System.out.println("You stuff is very private");
}
}
}