AP Computer Science A: Using Objects and Methods

0.0(0)
studied byStudied by 2 people
0.0(0)
linked notesView linked note
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

Class

A blueprint that defines the properties (fields) and behaviors (methods) shared by all objects of that type.

2
New cards

Object

An instance of a class that contains its own unique data and can perform actions defined by the class’s methods.

3
New cards

Instance Variable

A variable defined in a class that holds data unique to each object instance.

4
New cards

Method

A block of code within a class that performs a specific task, often operating on instance variables.

5
New cards

Constructor

A special method used to initialize new objects; it has the same name as the class and no return type.

6
New cards

Instantiation

The process of creating a new object from a class using the new keyword.

7
New cards

Encapsulation

The practice of hiding internal data using private fields and providing controlled access through public methods.

8
New cards

Getter Method

A public method that returns the value of a private instance variable.

Example: public int getAge() { return age; }

9
New cards

Setter Method

A public method that modifies a private instance variable.

Example: public void setAge(int a) { age = a; }

10
New cards

Static Method

A method that belongs to the class, not to an object instance, and can be called using the class name.

11
New cards

Instance Method

A method that operates on specific object data and can access instance variables.

12
New cards

Reference Type

A variable that stores the memory address of an object rather than the actual object value.

13
New cards

Primitive Type

A basic data type that stores simple values directly (e.g., int, double, boolean).

14
New cards

Null Reference

A reference variable that does not point to any object; calling methods on it causes a NullPointerException.

15
New cards

Method Overloading

Defining multiple methods with the same name but different parameter lists in the same class

16
New cards

Return Type

The data type of the value that a method sends back to the caller; void means no return value.

17
New cards

Access Modifier

A keyword that defines the visibility of class members (e.g., public, private, protected).

18
New cards

The this Keyword

Refers to the current object instance and is used to differentiate instance variables from parameters

19
New cards

Dot Notation

The syntax used to access an object’s methods or fields (e.g., car.getMake()).

20
New cards

Java API

A collection of prewritten classes and methods that developers can use to simplify coding tasks

21
New cards

Math Class

A built-in Java class providing static methods for mathematical operations.

Example: Math.sqrt(25);

22
New cards

String Class

A class in Java representing text data; includes methods like .length(), .toUpperCase(), .substring().

23
New cards

ArrayList Class

A resizable array structure in Java that can dynamically store objects.

Example: ArrayList<String> names = new ArrayList<>();

24
New cards

Default Constructor

The no-argument constructor automatically provided by Java if no other constructor is defined.

25
New cards

Overloaded Constructor

A constructor with parameters that allow initialization with specific values

26
New cards

Object Reference Comparison

Using == compares memory addresses, not object contents. Use .equals() to compare values

27
New cards

Polymorphism (Introductory)

The concept that different objects can respond to the same method call in their own way.

28
New cards

Parameter Passing

Supplying data to methods via arguments; Java passes arguments by value

29
New cards

Return Statement

Used in methods to send a value back to the caller and terminate method execution.

30
New cards

NullPointerException

A runtime error that occurs when trying to call a method or access a field through a null reference.