Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / nashiinformaticssolutions

A class that can possess only one object at a time is called a singleton class. To implement a singleton class given steps are to be followed:
1. Make sure that the class has only one object
2. Give global access to that object

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

when you will synchronize a piece of your code? : Java thread

0 Answers  


Does anyone still use java?

0 Answers  


How to sort numbers in java without array?

0 Answers  


Can we iterate through collection using for loop?

2 Answers   Rolta,


whats the life cycle of jsp

15 Answers   Satyam,


Define an enumeration?

0 Answers  


What modifiers can be used with a local inner class?

2 Answers  


What is meant by memory leak?

0 Answers  


Can a class have multiple constructors?

0 Answers  


What do you know about the garbage collector?

0 Answers  


How do generics work?

0 Answers  


Does treeset use compareto?

0 Answers  


Categories