Can we override singleton class?



Can we override singleton class?..

Answer / Sachin Chauhan

No, Singleton classes are designed to have only one instance and provide a global point of access to it. Since Java doesn't support multiple inheritance, you cannot use inheritance to extend a singleton class and create multiple instances. However, you can create a workaround by using double-check locking or the Enum technique.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are anonymous inner classes?

1 Answers  


What is serialversionuid?

1 Answers  


State some situations where exceptions may arise in java?

1 Answers  


What is linked hashset and its features?

1 Answers  


What is an infinite loop? How infinite loop is declared?

1 Answers  


What is the method in java?

1 Answers  


What is an argument in java?

1 Answers  


What is a default constructor and also define copy contrucyor?

1 Answers   Global Logic,


List the interfaces which extends collection interface?

1 Answers  


What are the different types of garbage collectors in java?

1 Answers  


How many types of memory areas are allocated by jvm?

1 Answers  


Is there is any difference between a scrollbar and a scrollpane?

1 Answers  


Categories