Which two of the following statements are true about constructors?
I. A constructor has no return type and is therefore a void method.
II. A constructor has the same name as the class.
III. A class can have more than one constructor.
IV. Constructors are called like any other method.
-
III and IV
-
I and II
-
II and III
-
I and IV
C
Correct answer
Explanation
Constructors have the same name as their class (statement II is true) and can be overloaded to provide multiple initialization options (statement III is true). Statement I is false because while constructors have no return type, they are not void methods. Statement IV is false because constructors are called automatically during object creation, not like regular methods.