Programming‎ > ‎Java‎ > ‎

Java-variables

Java modifier and how they affect access throughout your programs.
Modifier    | Class | Package | Subclass | World

public      |  Y    |    Y    |    Y     |   Y

protected   |  Y    |    Y    |    Y     |   N

no modifier |  Y    |    Y    |    N     |   N    <-----This is default for classes, variables, etc.

private     |  Y    |    N    |    N     |   N

public static void clarification

public means that any other object can access it.

static means that the class in which it resides doesn't have to be instantiated first before the function can be called.

void means that the function does not return a value.