+ 1
why to use starting by public
3 ответов
+ 5
Anmol Singh
Continue with the course, you'll learn about access modifiers (default, public, protected, private) in the classes and objects section of the course, and that should answer your question. Just follow along for now.
+ 1
with public it is "visible" for other packages,
without it can be used only for its package
0
Level of accessibility for access modifiers, from least accessible to most accessible is as follows:
private(no access) -> default(no modifier) -> protected -> public
Hope this helps.