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

Difference between process and thread?

705


What are the parts of methodology?

637


What is linkedlist in java?

597


Why scanner is used in java?

642


Which sorting algorithm is best in java?

633






What is void class in java?

618


How to use arraylist in java netbeans?

605


How do you add spaces in java?

609


Write a program to print fibonacci series up to count 10.

590


What is module in oop?

650


Is a method a function?

655


Can list be final in java?

585


How do I get a substring?

631


What is class and its types?

632


What are the advantages of autoboxing?

635