Computer Science, asked by sharath5044, 1 year ago

Which method is invoked automatically with creation of an object ?(a) Instance method
(b) Constructor(c) Class method
(d) All of the above

Answers

Answered by Anonymous
1
Hii

Q:- Which method is invoked automatically with creation of an object ?(a) Instance method
(b) Constructor(c) Class method
(d) All of the above


Ans:- Constructor
Answered by qwcricket10
0

When an object is created function constructor is automatically called.

  • For new objects, the initialization is done by the constructor.
  • The constructor makes the object ready to perform the assigned operations.
  • The values assigned to the objects by the constructor can be either user-given or default values.
  • The Constructor and the class share the same name.
  • The main purpose of the constructor is to make the object ready.
Similar questions