What is singleton class?

Answer Posted / sathya

Singleton class:
This is a class which can be instatiated only once.


Public class Singleton
private static single = new Singleton();

Private Singleton();

For a singleton class, the constructor is made private and
a static variable is used for instatiating the class.

Is This Answer Correct ?    240 Yes 44 No

Post New Answer       View All Answers

Please Help Members By Posting Answers For Below Questions

How to implement a multithreaded applet?


Can we call virtual funciton in a constructor ?


which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com


Why does java not allow multiple public classes in a java file ?


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.


What are the differences between Java 1.0 and Java 2.0?


How do you sing an Applet ?


Can you give names of Container classes?


How listener identify that the event came from a particular object?


how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT


placement papaers of spring computing technology


how to run ecllipse with jettyserver for windows environment using batch file


Name the components that are termed to be Heavy-weight component but available in Light-weight components?


what type of questions asked for barclays technologies pune please send urgent


Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification