Instances


#1

What are instances? Plain English please


#2

Think of your class declaration/definition as a blueprint.
Just because a blueprint exists of something doesn’t mean an object does.
Once you build the object that the blueprint specifies, then you have an instance of that class.

some pseudo code

class Dog{variables and functions} //tells me how to build a dog, currently no dogs exist.
Dog.new("Benji") // Now a dog named benji exists aka an instance of class dog

#3

Oh yea

Before I build a house I have to have a foundation(Class). Once I start building the house(object) then I got myself an instance…? an instance of a house…? an instance of a foundation?


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.