What is a singleton class in Java? And How to implement a singleton class?
Answers were Sorted based on User's Feedback
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 |
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 |
Difference between Reader/Writer and InputStream/Output Stream?
9 Answers Adobe, Kirusa, Verizon,
In a class implementing an interface, can we change the value of any variable defined in the interface?
What is the default value of float and double datatype in java?
what is the constructor and how many types of constructors are used in java?
84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.
What are 3 data types?
Is hashset sorted in java?
Difference between array and arraylist.
23 Answers Arise Solution, Banca Sella, iFocus, NIC, Sai Softech, Solartis, TCS, Verizon,
What sorting algorithm does javascript use?
What is the use of volatile in java?
How are variables stored in memory?
Explain the difference between hashmap and hashtable in java?