Java modifiers
From wikinotes
Modifiers are used to describe methods/attributes. They generally either limit access, or change how the item is treated by the JVM.
Access Modifiers | |
---|---|
public |
call from any instance |
protected |
call within package, and subclasses only. |
private |
call from this instance only. |
Other Modifiers | |
static |
call without instantiating object |
final |
value is not allowed to be modified, or overridden. |
abstract |
? |
transient |
attrs/methods will be skipped during serialization. |
synchronized |
method may only be accessed by one thread at a time. |
volatile |
? |
class MyClass {
// modifier type method-name
public String[] list_members() {
return {"alex", "courtney", "sam"};
}
}