Singleton class is a class whose only one object can be created at a time. - To achieve this one method is that we make its constructor private and provide a static method that returns its instance.:The static method that is provided to get the instance should be thread safe by marking the method as synchronized:singleton class is a classs in which at a time only one object can create.:A singleton is an class that can be instantiated once, and only once. This is a fairly unique property, but useful in a wide range of object designs. Creating an implementation of the singleton pattern is fairly straightforward - simple block off access to all constructors, provide a static method for getting an instance of the singleton, and prevent cloning.:Singleton class is a class whose only one object can be created and only that object is used by JVM. Even you cannot creat clone for that object.:class A:A class which must create only one object (ie. One instance) irrespective of any number of object creations based on that class.:Singleton class is a can be create at a time only one object but it can share memory:br:class A:singleton class is class which can create one object at a time.:Singleton class is a class in which we can create a only one object of the class.Some time for the undestanding we can create a only one object for the user specification.:Singleton class is a class, it allows jvm to create only one object.:What is SingleTon Class ?
Category:Java Interview Questions
No comments:
Post a Comment