[BP] Whats the difference between variable of class and object?

To understand classes and objects you have to understand a little bit about object oriented programming (OOP). A class is just a type. An Object is an instance of that Class which is defined by the type.

Here is one way to think of it. Say you have the plans to build a brand new 2015 Corvette (my next car). What you have is a Class. You don’t have the car you just have the plans to build one. When you instantiate (fancy programming term for build) a Class, you build the Corvette using the plans and you get an Object which is an instance of that Class. So the Object is a real Corvette that you built that actually exists. You can use a Class (the plans) to build as many Objects (the actual car) as you want. This is why the two are not interchangeable. Hope this helps!

2 Likes