In Java, a constructor is a special method used to initialize objects when they are created. Unlike regular methods, constructors have the same name as the class and no return type — not even void.
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following statements is true about constructors?
Correct
Incorrect
Question 4 of 15
4. Question
What happens if no constructor is defined in a class?
Correct
Incorrect
Question 5 of 15
5. Question
What is the purpose of a parameterized constructor?
Correct
Incorrect
Question 6 of 15
6. Question
Which keyword is used to call another constructor in the same class?
Correct
Incorrect
Question 7 of 15
7. Question
How many constructors can a class have?
Correct
Incorrect
Question 8 of 15
8. Question
What is constructor overloading?
Correct
Incorrect
Question 9 of 15
9. Question
Can constructors be inherited?
Correct
Incorrect
Question 10 of 15
10. Question
Which method is automatically called when an object is created?
Correct
Incorrect
Question 11 of 15
11. Question
Can constructors be static in Java?
Correct
Incorrect
Question 12 of 15
12. Question
What is the output of the following?
class Test { Test() { System.out.println(“Constructor called”); } public static void main(String[] args) { Test t = new Test(); } }
Correct
Incorrect
Question 13 of 15
13. Question
What will happen if you define only a parameterized constructor in a class?
Correct
Incorrect
Question 14 of 15
14. Question
What does `super()` do in a constructor?
Correct
Incorrect
Question 15 of 15
15. Question
Can a constructor be `private` in Java?
Correct
Incorrect
Summary
These MCQs help solidify understanding of Java constructors, including default and parameterized constructors, overloading, access levels, object initialization, and `this()` vs `super()` usage. Excellent for interviews, certification tests, and student evaluations.
At QuizOrbit, our team specializes in fun, informative quizzes across topics like general knowledge, technology, and entertainment. Boost your knowledge with our expert-designed quizzes.