+ 2

What is the difference between private and protected specifiers ?

Needs explaination with their properties.....thanks

20th Aug 2017, 5:39 PM
Hemant Jaiswal
Hemant Jaiswal - avatar
1 Odpowiedź
+ 2
`private` hides from other classes within the package. `public` exposes to classes outside the package. `protected` is a version of `public` restricted only to subclasses. you may find detailed docs here http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
20th Aug 2017, 6:24 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar