Modifiers Flashcards
What is an access modifier?
Is a keyword that is used to set the access level for classes, attributes, methods and constructors
Name the modifier groups
Access Modifiers
Non-Access Modifiers
Access Modifiers
Control the access level
Non-Access modifiers
Do not control access level but provide other functionality
Name the class access Modifiers
Public
Default
The public modifier makes the class
Accessible by any other class
The default modifier makes the class
Only accessible by classes in the same package
public, private, default and protected are modifiers for
Attributes, methods and constructors
The private modifier provides access
Only within the declared class
The protected modifier provides access to code
In the same package and subclass
The Non-Access modifiers include
final, abstract, static, transient, synchronized, volatile
The Non-Access modifiers for classes are
final and abstract
Attributes and methods use the following Non-Access modifiers
final, static, abstract, transient, synchronized, volatile
The final modifier for classes means
The class cannot be inherited by other classes
The abstract modifier for classes means
The class cannot be used to create objects