Modifiers and Features

Not all modifiers can be applied to all features.

Top-level classes may not be protected.

Methods may not be transient.

Static can apply it to free-floating blocks of code.

ModifierClassVariableMethodConstructorCode Block
publicyesyesyesyesno
protectednoyesyesyesno
empty accessoryesyesyesyesyes
privatenoyesyesyesno
finalyesyesyesnono
abstractyesnoyesnono
staticnoyesyesnoyes
nativenonoyesnono
transientnoyesnonono
volatilenoyesnonono
synchronizednonoyesnoyes
Home 
  Java Book 
    Class  

Access Control:
  1. Access Control
  2. Member Access and Inheritance
  3. Class Member Access Protection and Package
  4. Modifiers and Features