I do not understand clearly about class, I can't start more | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I do not understand clearly about class, I can't start more

I need more definition and usage for class PS I'm beginner for any language and I made self-study. Who want to share their knowledge Let's start

31st Dec 2016, 7:12 AM
Aung Hein Oo
Aung Hein Oo - avatar
5 Answers
+ 3
Imagine you to the beach and want to create a sand castle. You start putting sand and water then shape the mud until you get your castle. Or you can take a bucket that looks like castle, put the right amount of sand and water, put it upside-down and you got your self a castle. The bucket is your class, the sand and water are your class's constructor arguments, and putting it upside-down is the constructor body.
31st Dec 2016, 8:52 AM
Mohamed
+ 1
In coding class is a kinda block containing variables and functions that doesn't get the memory In real world, there several objects and those objects which share common properties like data and behavior (For example students are objects having same data like roll no. Subjects etc. And behavior like activities interest etc), we can define these properties by creating a class and can create different objects of that class Each object will have different values and separate memory
31st Dec 2016, 8:11 AM
Raj Kumar
+ 1
sorry for late reply bro I can't understand that in early so I made hand note and read it. tks for your answer. Next one is coming. Why do we use class as header file . Please
2nd Jan 2017, 4:05 AM
Aung Hein Oo
Aung Hein Oo - avatar
+ 1
This part is unique to C and C++. I am sorry I cannot answer that since I don't know C++ very well. You may post this specific question and I am sure someone will answer it.
2nd Jan 2017, 5:45 AM
Mohamed
+ 1
where can I get the notes for classes on the Internet?
4th Jan 2017, 7:28 PM
Pa Modou Mboob
Pa Modou Mboob - avatar