Object-Oriented Programming Prelim Exam Flashcards
Specifies all the information needed to call a method.
Method Declaration
Specifies whether other classes can use a particular field or invoke a particular method.
Access Modifier
The data type of the value returned by the method, or void if the method does not return a value.
Return Type
Should follow the naming convention rules.
Method Name
A comma-delimited list of input parameters, preceded by their data types and enclosed by parenthesis.
Parameter List
Indicates that the method might throw one of the listed exception types.
Optional Exception List
Everything that is enclosed between braces.
Method Body
Public, private, protected, package-private
Access Modifiers
This modifier allows the method to be visible to all classes everywhere.
Public
This modifier specifies that the method can only be accessed in its own class.
Private
This modifier specifies that the member can only be accessed within its own package and by a subclass of its class in another package.
Protected
This modifier (no modifier) specifies that the member can only be accessed within its own package.
Package-private
Any field declared with the static modifier.
Static variable or variable
This belongs to the class rather than the object of a class.
Static Method
Any variable or method that is non-static.
Instance variable or method