keyword | access |
none | If you don't give an access
modifier, every other method in this package can call it.
This is usually called package access and is
probably the most common type of access.
This is like giving your friends your telephone number. |
public | Everyone can call it.
You should use public if you want someone
outside your package to call the method. Some
common methods that are declared public are
paint(), init(),
actionPerformed(),
adjustmentValueChanged(), and main().
This is like making your phone number public -- anyone can
call you.
|
private | No one outside this class can call it.
This is like only letting your family call you. |
protected | Everyone in this package
and any child classes can use it.
You won't want to use this unless you are
devoloping classes that you expect others
to use for inheritance. |