+ 2

For what purpose do we use classes?

Is it kind of permissions?

10th Jan 2018, 8:52 PM
Touka
Touka - avatar
2 ответов
+ 3
You can think of a class as the basic unit of object oriented programming. Everything works by objects holding data, doing 'stuff' and interacting with other objects. But what do our objects look like? How do they behave? Classes define what our objects can do, what data they hold, and how they can interact. There is an element of permissions I guess, in that some code is restricted and only useable in the situations described in it's definitions.
10th Jan 2018, 9:00 PM
Dan Walker
Dan Walker - avatar
+ 2
Classes can be used as templates to build objects. The objects then have access to the class methods and properties.
10th Jan 2018, 10:54 PM
Bagshot
Bagshot - avatar