Class
- Public: Accessible from any other class
- Private: Only accessible from within the same class
- Static: Can only be used in nested classes
- Final: Class cannot be inherited from
- Abstract: Class cannot be instantiated, has to be inherited
- Protected: Accessible within the same package & by subclasses
- (no modifier): Only accessible within the same package
Variable (Field)
- Public: Accessible from any other class
- Private: Only accessible from within the same class
- Static: Shared between all instances of the class
- Final: Value cannot be changed after initialisation (can only be assigned once)
- Protected: Accessible within the same package & by subclasses
- (no modifier): Only accessible within the same package
Method
- Public: Accessible from any other class
- Private: Only accessible from within the same class
- Static: Can be called without creating an instance of the class
- Final: Cannot be overridden in subclasses
- Abstract: Implementation not provided, subclasses have to implement it
- Protected: Accessible within the same package & by subclasses
- (no modifier): Only accessible within the same package