What is the difference between class with public in the front and class without public?
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.
U are making me confused here!! Class without access specifier is considered as default specifier. while in C++ it is treated as private
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.
Class definition without modifier will indeed be considered as 'private'.