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

OOPS

Question 18
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 18 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 18 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
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!