What is a singleton class in Java? And How to implement a singleton class?

Answer Posted / nashiinformaticssolutions

A singleton class is one that can only have one object at a time. The following procedures must be followed in order to implement a singleton class:

Verify that there is only one object in the class.

Allow the item to be accessed globally.

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 printwriter in java?

613


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).

2328


What is a java predicate?

613


Can we clone singleton object in java?

671


what do you mean by marker interface in java?

652






Is java still necessary?

718


What is the null?

656


State the significance of public, private, protected class?

736


Is it necessary that each try block must be followed by a catch block?

657


Can we override constructor in java?

679


What if I write static public void instead of public static void in java?

698


What is hashing in java?

670


What is flush buffer?

622


Why use string handling in Java?

660


What if static is removed from main method?

658