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

What is a dynamic array in java?

560


What is anti pattern in programming?

494


What do you understand by overloading and overriding in java?

540


How does a for loop work java?

536


What is finalize()? Is finalize() similar to a destructor?

536






What does function identity () do?

515


What is an interoperable application in java ?

581


What is the difference between declaration and definition in java?

515


What is thread safe java?

490


Java is Pass by Value or Pass by Reference?

616


What is ternary operator?

562


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2050


What is difference between public static and void?

480


What are autoboxing and unboxing? When does it occur?

532


What is skeleton and stub?

587