...
Software-Engineering
August 29, 2024
OOPS
August 29, 2024
Software-Engineering
August 29, 2024
OOPS
August 29, 2024

OOPS

Question 11
What should be the name of the constructor
A
same as object
B
same as member
C
same as class
D
same as function
Question 11 Explanation: 
Constructor: a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. A constructor resembles an instance method, but it differs from a method in that it has no explicit return type, it is not implicitly inherited and it usually has different rules for scope modifiers. Constructors often have the same name as the declaring class. They have the task of initializing the object’s data members
Correct Answer: C
Question 11 Explanation: 
Constructor: a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. A constructor resembles an instance method, but it differs from a method in that it has no explicit return type, it is not implicitly inherited and it usually has different rules for scope modifiers. Constructors often have the same name as the declaring class. They have the task of initializing the object’s data members

Leave a Reply

Your email address will not be published. Required fields are marked *