#java public class and method

6 messages · Page 1 of 1 (latest)

carmine moss
#

What happens if you do not add public to the class and methods like in this picture?

novel heraldBOT
#

This post has been reserved for your question.

Hey @carmine moss! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

oak laurel
#

Then they aren't public.
When no visibility modifier is specified on a class or a class member, then its visibility is called "package-private". That means that only classes of the same package can see this class and these members

carmine moss
#

Oh I see, Thanks

novel heraldBOT
# carmine moss Oh I see, Thanks

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.