Exam-style question
Try this first
What is instantiation in object-oriented programming?.
- A.Hiding all methods in a class
- B.Creating an object based on a class using a constructor
- C.Combining two classes using a white diamond
- D.Replacing an inherited method with a property
Model answer
What a good answer should say
- Creating an object based on a class using a constructor
Explanation
Why this works
Objects based on a class are created using a constructor, which may be implicit or explicit. A reference to the object is assigned to a reference variable of the class type.
Common mistake
No common mistake is linked to this question yet.
