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

What is a buffer in java?

571


What is use of map in java?

509


What all methods are used to prevent thread execution ?

549


What are inbuilt functions?

563


How do you check if a string contains only numeric digits?

615






What does exclamation mean in java?

569


Write a program to search a number in the given list of numbers.

625


How to retrieve data from database in java using arraylist?

522


What will happen when using pass by reference in java?

520


Tell me about your ability to work under pressure

1765


Which is the best sorting technique in java?

517


What happens when you add a double value to a string?

538


Which collection is thread safe in java?

507


Explain the difference between transient and volatile in java?

571


What is final?

601