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 |
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?
What is the purpose of checked and unchecked exceptions in JAVA?
What are the advantages of java over cpp?
What are the core java topics?
What are examples of modifiers?
Explain JMS in detail.
How a variable is stored in memory?
If circular link of two objects, then will it be garbage collected ?
Can we override private method?
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); } }
Why non nested classes in java are not having marked as protected access specifier