What is a class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is a class?

8th Nov 2016, 7:20 PM
munish rastogi
munish rastogi - avatar
1 Answer
+ 2
A block of code which is used to store members, such as functions and variables. You can make a class on anything you like, such as an enemy in a video game, with members such as "int health" or "void attack()". Classes are good for structuring code, and will make life a whole lot easier if you were to start writing much larger programs. Classes are so useful in C++ especially, thanks to features such as inheritence and polymorphism.
8th Nov 2016, 7:45 PM
Cohen Creber
Cohen Creber - avatar