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 |
What are anonymous inner classes?
What is serialversionuid?
State some situations where exceptions may arise in java?
What is linked hashset and its features?
What is an infinite loop? How infinite loop is declared?
What is the method in java?
What is an argument in java?
What is a default constructor and also define copy contrucyor?
List the interfaces which extends collection interface?
What are the different types of garbage collectors in java?
How many types of memory areas are allocated by jvm?
Is there is any difference between a scrollbar and a scrollpane?