What is singleton class?




Answer Posted / sathya

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

Eg:

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

what is the messsage u r going to get from an objectoriented programing?

759


please send me hr interview questions in it industry

707


what is difference betweem home interface and remote interface?

1300


What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?

1027


What is the difference between Java1.4 and Java1.5

902


1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?

2194


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

2233


what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

832


hr interview how many minutes asking question

793


Tell me the Importent classes in net package?

798


What is files manifesting?

875


can any body body expalin best definitions & best real time exaples for opps concepts.

908


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

760


Tell me about your ability to work under pressure

880


Can you give names of Container classes?

1040