What is singleton class?

Answer Posted / kamlesh

SIngleton class is class which instantiate only once.means
suppose you are using JDBC/HIBERNATE in this don't need to
create the multiple instance for
Connection/SessionFactory , so for this we are using this
Singelton design pattern to create the instance for this.
and also with the help of static reference.

Is This Answer Correct ?    12 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When do you get classcastexception?

530


what invokes a threads run() method? : Java thread

551


What are the advantages of arraylist over arrays?

543


Can an interface have a class?

547


What are the four versions of java?

522






Explain about procedural programming language or structured programming language and its features?

524


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

577


What is the default value of the local variables?

483


How to perform linear search in java?

540


What is a generic data type?

550


Explain abstract class in java?

535


Explain about transient variables in java?

621


What is a get method?

503


In a class implementing an interface, can we change the value of any variable defined in the interface?

528


Can we declare a constructor as final?

650