+ 1

difference between public, private and protected?

Can any one please explain the difference between public, private and protected. It's very confusing. Thanks in advance :)

12th Dec 2019, 5:29 PM
Prakash Tiwari
Prakash Tiwari - avatar
3 Antworten
+ 3
public is for example your question, which can all see.
12th Dec 2019, 6:14 PM
JaScript
JaScript - avatar
+ 3
Public - you can use anywhere Private - you can use only inside a class Protected - you can use inside a class and in classes which inherit from
12th Dec 2019, 6:46 PM
id001x
id001x - avatar