1/15
Vocabulary flashcards covering Java method declarations, optional specifiers, access modifiers, and method components.
Method declaration
Specifies all the information needed to call a method.
Access modifier
Specifies whether other classes can use a particular field or invoke a particular method.
static
An optional specifier used for class methods.
abstract
An optional specifier used when a method does not have a body.
final
An optional specifier used when a method is not allowed to be overridden by a subclass.
Return type
The data type of the value returned by the method, or void if the method does not return a value.
Method name
The identifier of a method that should be a lowercase verb (ex. run) or a multi-word name beginning with a lowercase verb followed by capitalized words (ex. runFast).
Parameter list
A comma-delimited list of input parameters, preceded by their data types and enclosed by parentheses.
Optional exception list
Indicates that the method might throw one of the listed exception types.
Method body
Everything that is enclosed between braces, containing the method's code including the declaration of local variables.
Top level access control
Level of access control that can be public or package-private.
Member level access control
Level of access control that can be public, private, protected, or package-private.
Public modifier
Allows the method to be visible to all classes everywhere.
Private modifier
Specifies that the method can only be accessed in its own class.
Protected modifier
Specifies that the member can only be accessed within its own package and by a subclass of its class in another package.
Package-private modifier
Specifies that the member can only be accessed within its own package (used when no modifier is specified).