Studied in java that if a class have private constructor it cannot be inherited as super()
, cannot be called,than why this code compiles, in case of inner class:
public class TestMe2 {
class Singleton {
private Singleton() {
}
}
class BB extends Singleton {
}
public void callMe(){
Singleton sing=new BB();
}
}