What is a singleton class in Java? And How to implement a singleton class?

Answer Posted / nashiinformaticssolutions

A singleton class is one that can only have one object at a time. The following procedures must be followed in order to implement a singleton class:

Verify that there is only one object in the class.

Allow the item to be accessed globally.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is list ordered in java?

765


Explain the difference between transient and volatile in java?

760


Explain the reason behind ending a program with a system.exit(0)?

790


What is an array length?

681


Explain numeric promotion?

799


Is oracle charging for java?

765


Can a static class implement an interface?

789


What is the differences between heap and stack memory in java? Explain

724


What is equals method in java?

735


What are the advantages of functions?

705


Explain about features of local inner class?

806


What’s meant by anonymous class?

831


What is immutable data?

805


What do you mean by JVM?

786


What is r * in math?

724