Showing posts with label Java Modifiers Classification. Show all posts
Showing posts with label Java Modifiers Classification. Show all posts

Sunday, 7 June 2015

Java Modifiers

Introduction

Modifiers are Java keywords that give the compiler information about the nature of code, data, classes or interfaces. For example, we have been using visibility modifiers public, private, protected, package etc. to specify the visibility of class members.  Beside visibility we have also used the modifiers static and abstract.

Classification

  • For the purpose of clear understanding, modifiers can be categorized as:
  • Accessibility modifiers for top-level classes and interfaces.
  • Member accessibility/visibility modifiers for classes.
  • Member accessibility/visibility modifiers for interfaces.
  • Other modifiers for top-level classes.
  • Other modifiers for top-level interfaces.
  • Other modifiers for interface members.
  • Other modifiers for class members.