Saturday, October 29, 2011

In Java, what's the difference between public, default, protected, and private?

Modifier    | Class | Package | Subclass | World

public      |  Y    |    Y    |    Y     |   Y

protected   |  Y    |    Y    |    Y     |   N

no modifier |  Y    |    Y    |    N     |   N

private     |  Y    |    N    |    N     |   N
http://stackoverflow.com/questions/215497/in-java-whats-the-difference-between-public-default-protected-and-private

No comments:

Post a Comment