Why should we use singleton pattern instead of static class?
Answer / Sujata Gupta
While a static class can achieve similar results, the Singleton pattern provides more control. It allows for lazy initialization (eager or on-demand), enforcement of thread safety, and enables the instance to hold state information.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a marker interface?
State the merge-sort principle and its time complexity.
1 Answers Akamai Technologies,
Are strings immutable in java?
What is string in java?
How do you start a new line in java?
What are the new features in java 8? Explain
What is primitive array?
is there a separate stack for each thread in java? : Java thread
What do you mean by mnemonics?
Is 'null' a keyword?
List the different types of classloaders in java.
What is bubble sorting in java?