What is singleton class?

Answer Posted / ashish srivastava

public class Singleton {

private static Singleton s = new Singleton();

private Singleton(){

}

public static Singleton getObject(){
return s;
}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which class is the wait() method defined in? : Java thread

509


Explain java thread life cycle.

571


In java, how we can disallow serialization of variables?

540


How many ways can we create singleton class?

488


What are different exception types exceptions available in java ?

466






What is break and continue statement?

599


What are data structures in java?

520


Why java is a platform independent? Explain

523


What is arraylist class in java?

494


How do you make a thread in java?

616


What is a newline character in java?

549


What does \ mean in regex?

608


what is the final keyword denotes in java?

571


how does multithreading take place on a computer with a single cpu? : Java thread

672


How are the elements of a gridbaglayout organized in java programming?

505