1/24
A comprehensive set of flashcards covering access modifiers, method structure, and static/abstract/final modifiers from the notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Access Modifier in Java
Specifies the visibility of a method or field; the modifiers are public, protected, package-private (no modifier), and private.
Four access modifiers in Java
Public, protected, package-private (no modifier), and private.
Arguments in Java
The actual values that are passed into a method when it is invoked.
Autoboxing
The automatic conversion between primitive types (e.g., int) and their corresponding wrapper classes (e.g., Integer).
Exception List in a method declaration
The list of exceptions a method might throw, declared with the throws keyword.
Instance variable/method
A non-static variable or method that belongs to an object of the class; requires an instance to be created before it can be used.
Method Body
The code block enclosed in braces {} that contains the method’s executable statements.
Method Declaration
Specifies all information needed to call a method: access modifiers, return type, name, parameters, and exceptions.
Method Name
The name used to call the method; should be a verb in lowercase or a multi-word name starting with a verb.
Method Overloading
Occurs when multiple methods in the same class have the same name but different parameter lists (different signatures).
Method Signature
Consists of the method's name and its parameter types.
Optional Specifier
Adds special properties to a method, such as static, abstract, or final.
Package-private modifier
The access level when no modifier is used; the member can only be accessed within its own package.
Parameter List
A comma-delimited list of input parameters for a method, enclosed in parentheses.
Parameters
The variables listed in a method declaration.
Pass-by-value in Java
The policy where a copy of a variable's value is passed to a method. Assignments to the parameter inside the method do not affect the original argument.
Private modifier
An access modifier that specifies a member can only be accessed within its own class.
Protected modifier
An access modifier that specifies a member can be accessed within its own package and by subclasses in other packages.
Public modifier
An access modifier that allows the method or field to be visible to all classes everywhere.
Return Type
The data type of the value a method returns, or void if it returns nothing.
Static method
A method that belongs to the class rather than an object; can be invoked without creating an instance and can only access static members.
Static variable (class variable)
A field declared with the static modifier; there is exactly one copy of this variable, shared by all instances of the class.
Abstract modifier
Used when a method does not have a body.
Final modifier
Used when a method is not allowed to be overridden by a subclass.
Static modifier
Used for class methods and variables; it signifies the member belongs to the class itself.