why a class can not be subclassed if i declare its default constructor as private <blockquote> <p>In a class i can have as many constructors as I want with different argument types. I made all the constructors as private,it didn't give any error because my implicit default constructor was public But when i declared my implicit default constructor as private then its showing an error while extending the class. <strong>WHY?</strong></p> </blockquote> <h2>this works fine</h2> <pre><code>public class Demo4 { private String name; private int age; private double sal; private Demo4(String name, int age) { this.name=name; this.age=age; } Demo4(String name) { this.name=name; } Demo4() { this("unknown", 20); this.sal=2000; } void show(){ System.out.println("name"+name); System.out.println("age: "+age); } } </code></pre> <h2>This can not be inherited</h2> <pre><code>public class Demo4 { private String name; private int age; private double sal; private Demo4(String name, int age) { this.name=name; this.age=age; } Demo4(String name) { this.name=name; } private Demo4() { this("unknown", 20); this.sal=2000; } void show() { System.out.println("name"+name); System.out.println("age: "+age); } } </code></pre>