Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
variables within a class private
why its not the rule?
1 Antwort
+ 1
It is the rule. You must have heard about encapsulation, so exposing every variable of the class is not recommended because you do not want every user to alter the value of a program that you created.
Edit: Need not be private at all times but it is a good practice.