Can we inherit a class with private constructor?



Can we inherit a class with private constructor?..

Answer / Arti Rajput

No, it is not possible to inherit a class with a private constructor. Private constructors limit the creation of objects outside of their defining class and cannot be accessed by subclasses.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

abstract class Demo { public void show() { System.out.println("Hello I am In show method of Abstract class"); } } class Sample extends Demo { public void show() { super.show(); System.out.println("Hello I am In Sample "); } } public class Test { public static void main(String[] args) { //I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT SUPPORTED THAT :: OPERATORE } }

3 Answers  


Write a function for palindrome and factorial and explain?

1 Answers   Honeywell, Huawei, Zomato,


What is an infinite loop?

3 Answers  


What is the protected method modifier?

1 Answers  


How do u pass data from one jsp to another jsp?

3 Answers   Fidelity,


where lives in jvm

5 Answers  


How do you compare values in java?

1 Answers  


What is a deadlock ?

5 Answers  


What is advantage of java?

1 Answers  


Name the types of mouse event listeners ?

2 Answers  


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1 Answers  


Difference between linkedlist and arraylist.

1 Answers  


Categories