What is the difference between public/private and protected modifiers in Java?

A class may be declared with the modifier public , in which case that class is visible to all classes everywhere. … The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.

Sizin İçin Seçtik  TL'nin nasıl yazılır?

Leave a Reply

Your email address will not be published. Required fields are marked *