How do you achieve singleton?
Answer / Deepak Ekka
In Java, Singleton can be achieved by declaring a private constructor, providing a static method to create the instance, and storing the single instance in a static field.
| Is This Answer Correct ? | 0 Yes | 0 No |
Accenture NJ mostly ask question on Collection like 1)How to sort Objcts and how treeset sort them 2)Explain mechanism of Hashcode finding in Java 3)Name some of the Sorted collection.
What is navigable map in java?
What does java se mean?
Can I use % with real numbers?
What is dynamic binding?
Is jdk required on each machine to run a java program?
What is a constructor, constructor overloading in java?
What is the effect of keeping a constructor private?
What is void class in java?
In treeset we add same object ...what will be the out put
Can static method access instance variables ?
What is the main purpose of serialization in java?