Can we extend singleton class in java?



Can we extend singleton class in java?..

Answer / Pinky Sagar

No, extending a singleton class is not allowed because the primary purpose of a singleton is to ensure only one instance exists and inheritance would create multiple instances.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is an empty class? What functionality does it offer in Java?

1 Answers   Deloitte, EXL, JPMorgan Chase,


When to use runnable interface vs thread class in java?

1 Answers  


What is the purpose of checked and unchecked exceptions in JAVA?

1 Answers   Amdocs,


What are the advantages of java over cpp?

1 Answers  


What are the core java topics?

1 Answers  


What are examples of modifiers?

1 Answers  


Explain JMS in detail.

1 Answers   Amdocs,


How a variable is stored in memory?

1 Answers  


If circular link of two objects, then will it be garbage collected ?

3 Answers   TCS,


Can we override private method?

1 Answers  


public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10; Integer c = 145; Integer d = 145; System.out.println(a==b); System.out.println(c==d); } }

7 Answers   iGate,


Why non nested classes in java are not having marked as protected access specifier

2 Answers   Google,


Categories