Advertisements
Advertisements
Question
Which of the following statements is false?
Options
A constructor has same name as class name.
A constructor returns initial value.
A constructor is called while creating an object.
A constructor is not used for arithmetical and logical operations.
MCQ
Solution
A constructor returns initial value.
Explanation:
A constructor does not return any value, including void. It is called automatically to set the object's state at object creation, but it returns nothing.
shaalaa.com
Is there an error in this question or solution?