access modifier

access modifier

private : within same class.

defualt : within same package.

protected : within same package and child class in different package.

public : no limit.

There are only two possible modifiers for class : public or (default).

There are four possible modifiers for members(variable/method) : public, protected, (default), private.

Last updated

Was this helpful?