+ 1
What is the difference between class with public in the front and class without public?
4 odpowiedzi
+ 4
Class with public access specifier can be accessed within the class, other classes and other packages too, whereas without access specifier it will become default access specifier which means that it will be accessed only within the current class and only in the same package.
+ 1
U are making me confused here!!
Class without access specifier is considered as default specifier. while in C++ it is treated as private
0
Class without 'public' modifier in front of it means it is implicitly 'default'. 'default' modifier gives it package level access i.e. that class can be accessed anywhere within package only.
- 1
Class definition without modifier will indeed be considered as 'private'.