Which of the following is a correct statement about constructors in Java?
2024
Which of the following is a correct statement about constructors in Java?
- A.
Constructors cannot be overloaded.
- B.
A constructor can be called directly like a regular method.
- C.
A constructor does not have a return type, not even void type.
- D.
A class can have only one constructor.
- E.
Question not attempted
Attempted by 64 students.
Show answer & explanation
Correct answer: C
A Java constructor has the same name as its class and has no return type, not even void. Constructors can be overloaded, so the statement that a class can have only one constructor is false.