4.10. Other Modifiers for Members

Certain characteristics of fields and/or methods can be specified in their declarations by the following keywords:

  • static

  • final

  • abstract

  • synchronized

  • native

  • transient

  • volatile

static Members

The declaration of static members is prefixed by the keyword static to distinguish them from instance members.

Static members belong to the class in which they are declared, and are not part of any instance of the class. Depending on the accessibility modifiers of the static members in a class, clients can access these by using the class name, or through object references of the class. The class need not be instantiated to access its static members.

Static variables (also called class variables) only exist in the class they are ...

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.