What is singleton class?




Answer Posted / abhijith thette nagarajan

As per the definition,Singleton class in one such class
which will have only one instance of it at any given point
of time...

But,it is allowed to any number of instances,not
necessarily be one..

Generally its contructor will have "protected" key work,no
problem also if we have private also,but if it is
private,we need to have a getter method to create an
instance...

Is This Answer Correct ?    34 Yes 20 No




Post New Answer   View All Answers


Please Help Members By Posting Answers For Below Questions

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


how to one war file class to another war file class?

790


FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

1452


whatis Home interface and Remoteinterface? with example?

744


why using interface interface ?

619


what is the use of bean managed and container managed with example?

780


What collections you have worked on? Internal working of Hashmap?

939


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

932


How to print nodes of a Binary tree?

955


what r advatages of websphere? & how to deploy?

817


What is files manifesting?

875


What is your platform?s default character encoding and how to know this?

898


If goto and const is reserve words than why it is not work in java?

674


please send me hr interview questions in it industry

707


Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

1406