Objects and classes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Objects and classes

I don't understand them

14th Nov 2016, 2:01 PM
Ziyaan Hassan
Ziyaan Hassan - avatar
1 Answer
+ 2
This is not an easy question. I will try to anwer ist... A class is a blueprint or template or set of instructions to build a specific type of object. Every object is built from a class. Each class should be designed and programmed to accomplish one, and only one, thing. Because each class is designed to have only a single responsibility, many classes are used to build an entire application. An example is the easiest way to understand the difference. Look at a street there are many cars, but the most of them are different. With a closer/abstracter look they all have some special properties like tires and colors... So you have a class named cars with the properties color and number of tires. Than you create an instance (object) from the class cars named blueCar. Now this instance can have special properties like blue color and four tires. I think this page can help you to understand the difference and the concept: http://www.tutorialspoint.com/cplusplus/cpp_classes_objects.htm
14th Nov 2016, 2:38 PM
Sven G
Sven G - avatar