Heya.
I wrote a simple class using public and private.
can someone explain a bit more about the private part?
About data members, and why private exist.
thx.
Heya.
I wrote a simple class using public and private.
can someone explain a bit more about the private part?
About data members, and why private exist.
thx.
Private makes something inaccessible by the outside world. It allows information-hiding. It's one of the most important concepts in OOP. I won't try to explain it, because any half-decent book (or even Google) will explain it better than I can.
Thx for the answers, maybe I can ask another question.
a parentes that have nothing in them, just ().. why do I sometimes need them? when they are just empty, like getGameName();
Every function call needs parentheses, to distinguish it from a variable. If the function doesn't take any parameters, then the parentheses will be empty.
I dont fully understand, but I will read more, thx for the fast replies =)