How to prevent to create multiple objects of a java class?
Answer Posted / naseer
declare constructor as private .that class only create one object
Is This Answer Correct ? | 10 Yes | 6 No |
Post New Answer View All Answers
What is difference between path and classpath variables?
How will you print number in reverse (descending) order in BST.
What are inner classes or non static nested classes in java?
What are internal and external variables?
What is a function in java?
What is a blocking method in Java?
Why hashcode is used in java?
How is treeset implemented in java?
Does substring create a new object?
What is the syntax and characteristics of a lambda expression? Explain
Explain about serializable interface in java?
What is super constructor?
What is a parameter used for?
What are the major advantages of internal iteration over external iteration?
How many return statement are allowed in a function?