1 Answer
+ 1
A class is basically a container that has both data and behaviour (methods). Using classes you can model real life items in code.
When modelling an administration for furniture you can have:
- a class named Administration that maintains a list of furniture. So it has the mentioned list as data and stuff like AddItem(...), RemoveItem(...) and so on as behaviour.
- a class named furniture that has generic data and methods for all furniture. Generic data can be stuff like a date on which you bought the item and what its price was
- a subclass table that inherits from furniture that adds the number of legs and material to the base class.
Does that help?
Did you read through https://en.wikipedia.org/wiki/Class_(computer_programming)? Maybe that helps too?