How to implement Singleton

Answer Posted / ajooba

since 1.5 version best way is to use an enum

public enum My
{
instance;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we find the sum of two linked lists using stack in java?

783


What are the differences between checked exception and unchecked exception?

753


What are the 2 types of java programs?

801


How is string immutable in java?

795


What do you mean by local class?

765


whatis Home interface and Remoteinterface? with example?

1769


How can you read content from file in java?

807


Why arraylist is not synchronized in java example?

692


What are the topics in core java?

809


Explain reverse a linked list iterative solution in java?

713


Is main a function?

715


What are the super most classes for all the streams?

1835


What is a databasemetadata?

732


Write a program to find maximum and minimum number in array?

769


What is stored procedure. How do you create stored procedure ?

1746