adplus-dvertising
frame-decoration

Question

What is true about private constructor?

a.

Private constructor ensures only one instance of a class exist at any point of time

b.

Private constructor ensures multiple instances of a class exist at any point of time

c.

Private constructor eases the instantiation of a class

d.

Private constructor allows creating objects in other classes

Answer: (a).Private constructor ensures only one instance of a class exist at any point of time

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is true about private constructor?

Similar Questions

Discover Related MCQs

Q. What would be the behaviour if this() and super() used in a method?

Q. What is false about constructor?

Q. What is true about Class.getInstance()?

Q. What is true about constructor?

Q. Abstract class cannot have a constructor.

Q. What is true about protected constructor?

Q. What is not the use of “this” keyword in Java?

Q. What would be the behaviour if one parameterized constructor is explicitly defined?

Q. What would be behaviour if the constructor has a return type?

Q. Which of the following has the highest memory requirement?

Q. Where is a new object allocated memory?

Q. Which of the following is a garbage collection technique?

Q. What is -Xms and -Xmx while starting jvm?

Q. Which exception is thrown when java is out of memory?

Q. How to get prints of shared object memory maps or heap memory maps for a given process?

Q. What happens to the thread when garbage collection kicks off?

Q. Which of the below is not a Java Profiler?

Q. Which of the below is not a memory leak solution?

Q. Garbage Collection can be controlled by a program?

Q. What is the process of defining two or more methods within same class that have same name but different parameters declaration?