Profile photo for Quora User

It is the creation of a new instance of an object, with respect to OOP.

Suppose we have a programming class called “Dog”. To instantiate this class we create a new object of type Dog. We would do something like this:

  1. // this is instantiation 
  2. Dog myDog = new Dog(); 
  3. // set properties of the dog 
  4. myDog.setName(“Fido”); 
  5. myDog.setAge(3); 
  6. myDog.setBreed(“Airedale”); 
  7. // other instantiation methods, if the constructor is overloaded 
  8. Dog bigDog = new Dog(“Rover”, 4, “Great Dane”); 
View 3 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025