0

Should I create another class? why?

https://code.sololearn.com/ceyEZDgG5TtM/?ref=app

24th Oct 2022, 2:25 AM
Mozzie
Mozzie - avatar
1 ответ
+ 2
Kim Jonas Cabugayan Class means category for example a person, a student, a vehicle which can have different behaviour so we cannot put each thing in a single category. So that's why different classes for each category. Since you have only one category so it is not necessary. As you are going to implement incapsulation feature so it would be better to make a class then set and get values. If you write in same class then you cannot implement it because you can access private in same class but in case of incapsulation it is avoid because you don't want someone access your private member directly and change value that's why class members should be private.
24th Oct 2022, 4:50 AM
A͢J
A͢J - avatar