WHAT ARE DIFFERENT TYPES OF ACCESS MODIFIERS

Pushpendra Singh

Total Post:241

Points:1205
Posted by  Pushpendra Singh
Java 
 986  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    What are different types of access modifiers

    Public: Any thing declared as public can be accessed from anywhere.

    Private: Any thing declared as private can’t be seen outside of its class.

    Protected: Any thing declared as protected can be accessed by classes in the same package and subclasses in the other packages.

    Default modifier : Can be accessed only to classes in the same package.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!