Whats the difference between public, private and protected in java..??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Whats the difference between public, private and protected in java..???

22nd Sep 2017, 5:32 AM
Syed Abdhahir
Syed Abdhahir - avatar
2 Answers
+ 4
Read about Java access modifiers here: http://www.geeksforgeeks.org/access-modifiers-java/ Hth, cmiiw
22nd Sep 2017, 6:19 AM
Ipang
+ 1
private - accessible to the classes only. protected - accessible to class, package, and subclasses [default] - accessible to the class and package public - accessible to global More... http://net-informations.com/java/basics/modifiers.htm
2nd Oct 2019, 4:07 AM
rahul kumar
rahul kumar - avatar