I've been Google-ing a lot, but still I didn't understand what a class actually is. Can somebody explain it to me? Please be detailed.
Thank you.
Printable View
I've been Google-ing a lot, but still I didn't understand what a class actually is. Can somebody explain it to me? Please be detailed.
Thank you.
It's a template for an object. Think of standard role-playing games. They have character classes including Mage, Warrior and Cleric. They use class in the same sense as programming, i.e. characters are classified as either Mage, Warrior or Cleric. You can't use those classes in the game. You have to create a character first. Each character you create is either a Mage, a Warrior or a Cleric. The characters are like objects in programming. An object is an instance of a class, i.e. an embodiment of the template described by the class. Each object has values for the properties defined by the class and can execute the methods defined by the class.