1.

What Are The Access Modifiers Available In Java?

Answer»

Access modifier specify where a METHOD or ATTRIBUTE can be USED.

  • Public is accessible from anywhere.
  • Protected is accessible from the same class and its SUBCLASSES.
  • Package/Default are accessible from the same package.
  • Private is only accessible from within the class.

Access modifier specify where a method or attribute can be used.



Discussion

No Comment Found