0
Guys can anyone explain classes and objects to me ....in the simplest way possible with a C++ illustration please?
3 Réponses
+ 1
rohan can you please show me how to apply this in c++ cause when you say it like that I understand but when it comes to application of this in c++ language I get confused please
+ 1
I would describe it as such:
class - This is your blueprint. It gives you all the specifics of how to build.
- ex.: You have the design for a house (your blueprint). The walls are all the same, the roof is made of a particular material, and even the pipes connect certain rooms.
object - This is a unique instance of the build. It has the same structure of the class but the data contained within is unique to that object.
- ex.: The blueprints are used to build a house for John and Sally. Their houses look the same but what makes it John's house is that it is full of John's personal items. These items collectively are specific to John's house.
0
a student is a class
and a specific students lets take a student named David is a object of class student