logo

Question detail

What is instantiation in object-oriented programming?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming paradigms

Exam-style question

Try this first

What is instantiation in object-oriented programming?.

  1. A.Hiding all methods in a class
  2. B.Creating an object based on a class using a constructor
  3. C.Combining two classes using a white diamond
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.