Home > DeveloperSection > Interviews > What are different types of access modifiers

Posted on    October-25-2010 12:00 AM

 Java Java 
 1 Answer(s)
  765  View(s)
Rate this:

Pushpendra Singh

Total Post:241

Posted on    November-08-2010 1:00 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick