Modifiers in Java

Understanding modifiers in Java and its sphere of influence

 

Modifiers Types (classes, Enums) Field Method
public YES YES YES
private only inner Types YES YES
protected only inner Types YES YES
default YES YES YES
abstract YES NO YES
final YES YES YES
static only inner Types YES YES
synchronized NO NO YES
transient NO YES NO
volatile NO YES NO
native NO NO YES

 

 

[addToAppearHere]

For further detail on each modifiers please follow the links.

 

Accessibility Modifiers :

public
private
protected
default

 

Other modifier :

static
final