Declaration Context |
Access Modifiers |
Allows Static Members |
Allows Non-Static Members |
Has Access to enclosing data |
Has Access to local variables |
package level class |
public, default |
yes |
yes |
* |
* |
static member class |
all |
yes |
yes |
static members |
* |
member interface |
public |
yes, but only for data |
yes, but only for methods |
static members |
* |
member classes in interface |
public |
yes |
yes |
static members |
* |
non-static member class |
all |
no |
yes |
static and non-static members |
* |
local class in static context |
none |
no |
yes |
static members |
only final variables |
local class in non-static context |
none |
no |
yes |
static and non-static members |
only final variables |
anonymous class in static context |
none |
no |
yes |
static members |
only final variables |
anonymous class in non-static context |
none |
no |
yes |
static and non-static members |
only final variables |
Declaration Context |
Access Modifiers |
Allows Static Members |
Allows Non-Static Members |
Has Access to enclosing data |
Has Access to local variables |