Java OOP Exam Reviewer: Access Modifiers, Methods, and Static/Abstract/Final modifiers

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

flashcard set

Earn XP

Description and Tags

A comprehensive set of flashcards covering access modifiers, method structure, and static/abstract/final modifiers from the notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

Access Modifier in Java

Specifies the visibility of a method or field; the modifiers are public, protected, package-private (no modifier), and private.

2
New cards

Four access modifiers in Java

Public, protected, package-private (no modifier), and private.

3
New cards

Arguments in Java

The actual values that are passed into a method when it is invoked.

4
New cards

Autoboxing

The automatic conversion between primitive types (e.g., int) and their corresponding wrapper classes (e.g., Integer).

5
New cards

Exception List in a method declaration

The list of exceptions a method might throw, declared with the throws keyword.

6
New cards

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.

7
New cards

Method Body

The code block enclosed in braces {} that contains the method’s executable statements.

8
New cards

Method Declaration

Specifies all information needed to call a method: access modifiers, return type, name, parameters, and exceptions.

9
New cards

Method Name

The name used to call the method; should be a verb in lowercase or a multi-word name starting with a verb.

10
New cards

Method Overloading

Occurs when multiple methods in the same class have the same name but different parameter lists (different signatures).

11
New cards

Method Signature

Consists of the method's name and its parameter types.

12
New cards

Optional Specifier

Adds special properties to a method, such as static, abstract, or final.

13
New cards

Package-private modifier

The access level when no modifier is used; the member can only be accessed within its own package.

14
New cards

Parameter List

A comma-delimited list of input parameters for a method, enclosed in parentheses.

15
New cards

Parameters

The variables listed in a method declaration.

16
New cards

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.

17
New cards

Private modifier

An access modifier that specifies a member can only be accessed within its own class.

18
New cards

Protected modifier

An access modifier that specifies a member can be accessed within its own package and by subclasses in other packages.

19
New cards

Public modifier

An access modifier that allows the method or field to be visible to all classes everywhere.

20
New cards

Return Type

The data type of the value a method returns, or void if it returns nothing.

21
New cards

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.

22
New cards

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.

23
New cards

Abstract modifier

Used when a method does not have a body.

24
New cards

Final modifier

Used when a method is not allowed to be overridden by a subclass.

25
New cards

Static modifier

Used for class methods and variables; it signifies the member belongs to the class itself.