+ 4
I dont understand class and object on C++
I made the lesson on class and object for c++ and I cant understand as im not english, can you plz explain me with simpler word.
12 Answers
+ 9
A class is a template for building an object. A class is like a cookie cutter and an object is like the cookie that is made. An object stores fields. A class is like the type of the object.
+ 7
Topcat no worries buddy, there was a time i thought the same đđ
+ 6
Thanks for the clarification Mod D_Stark .
+ 5
Sonic That's my dialoge XD
+ 3
Its ok keep trying to understand i also ripped my xp skipping those questions and try to skip that lesson in that time lol but now i have a clear understanding
+ 3
Topcat member functions are not stored in objects as there the same for all instances of that class only its fields are stored, a class is a template in which you create objects from đ
+ 2
XD thank you, again topcat, I love your exemple
+ 2
A class is a data structure that can contain both variables and functions in a single entity. These
are collectively known as its âmembersâ, and the functions are known as its âmethodsâ.
+ 1
An object is created using classes, which are actually the focal point of Object Oriented Pruducts (OOP) while classes describe what that object will be, but is separated from the object itself
0
Class is a blueprint of an object. Class person{
String firstname;
String lastname;
}
Person is the object.
Person a = new person()
A.firstname = "john" ;
A.lastname = "doe" ;
0
You can understand in such a way that,
Class name is like a new data type that is user creating and object is a variable whose data type is that class name.
I'm not much sure about this.
Can anybody tell me about my answer that is it correct or not??
0
Class