I dont understand class and object on C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

9th Feb 2019, 7:21 AM
Bored D
Bored D - avatar
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.
9th Feb 2019, 8:17 AM
Sonic
Sonic - avatar
+ 7
Topcat no worries buddy, there was a time i thought the same 😉👍
9th Feb 2019, 3:31 PM
D_Stark
D_Stark - avatar
+ 6
Thanks for the clarification Mod D_Stark .
9th Feb 2019, 1:50 PM
Sonic
Sonic - avatar
+ 5
Sonic That's my dialoge XD
1st Mar 2019, 10:28 AM
Shahil Ahmed
Shahil Ahmed - avatar
+ 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
9th Feb 2019, 9:41 AM
Shahil Ahmed
Shahil Ahmed - avatar
+ 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 👍
9th Feb 2019, 11:31 AM
D_Stark
D_Stark - avatar
+ 2
XD thank you, again topcat, I love your exemple
9th Feb 2019, 8:38 AM
Bored D
Bored D - avatar
+ 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”.
14th Feb 2019, 10:32 PM
7_7
7_7 - avatar
+ 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
12th Feb 2019, 2:32 PM
Wanangwah
Wanangwah - avatar
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" ;
10th Feb 2019, 9:12 PM
Milivojevic Viktor
Milivojevic Viktor - avatar
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??
11th Feb 2019, 7:02 PM
shahzad
shahzad - avatar
0
Class
27th Feb 2019, 6:07 AM
pradeep kumar
pradeep kumar - avatar