AP Computer Science A - Unit 9 Vocabulary

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

1/17

flashcard set

Earn XP

Description and Tags

Definitions blank out the Term. Multiple blanks do not mean multiple terms; it is the same term blanked out multiple times.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards

Object

____ do the action in an ____-oriented program. An ____ can have things it knows (attributes) and things it can do (methods). An ____ is created by a class and keeps a reference to the class that created it.

2
New cards

Class

A ____ defines what all objects of that ____ know (attributes) and can do (methods). You can also have data and behavior in the object that represents the ____ (____ instance variables and methods). All objects of a ____ have access to ____ instance variables and ____ methods, but these can also be accessed using ____Name.variable or ____Name.method().

3
New cards

Inheritance

One class can use ____ to acquire the object instance variables and methods from another. This makes it easy to reuse another class by extending it (using ____ from it). This is called specialization. You can also pull out common instance variables and/or methods from several related classes and put those in a common parent class. This is called generalization.

4
New cards

Polymorphism

The runtime type of an object can be that type or any subclass of the declared type. All method calls are resolved starting with the class that created the object. If the method isn’t found in the class that created the object, then it will look in the parent class and keep looking up the inheritance tree until it finds the method. The method must exist, or the code would not have compiled.

5
New cards

Parent class

One class can inherit from another and the class that it is inheriting from is this. The ____ is specified in the class declaration using the extends keyword followed by the ____ name.

6
New cards

Child class

The class that is doing the inheriting. It inherits access to the object instance variables and methods in the parent class.

7
New cards

Subclass

A child class is also called this.

8
New cards

Superclass

A parent class is also called this.

9
New cards

Declared type

The type that was used in the declaration. list aList = new ArrayList() has a ____ of List. This is used at compile time to check that the object has the methods that are being used in the code.

10
New cards

Run-time type

The type of the class that created the object. List aList = new ArrayList() has a ____ of ArrayList. This is used at run-time to find the method to execute.

11
New cards

Overrides

A method in a child class can have the same method signature (method name and parameter list) as a method in the parent class. Since methods are resolved starting with the class that created the object, that method will be called instead of the inherited parent method, meaning the child method ____ the parent method.

12
New cards

Overload

Two or more methods with the same name but different parameter lists. The parameter lists can differ by the number or types of parameters.

13
New cards

Getter

A method that returns the value of an instance variable in an object.

14
New cards

Setter

A method that sets the value of an instance variable in an object.

15
New cards

Accessor

Another name for a getter method — one that returns the value of an instance variable.

16
New cards

Mutator

Another name for a setter method — one that changes the value of an instance variable.

17
New cards

Extends

Used to specify the parent class to inherit from. It is followed by the name of the parent class, like this: public class ChildName extends ParentName. If no extends keyword is used in the class declaration, then the class will automatically inherit from the Object class.

18
New cards

Static

Keyword used to indicate that an instance variable or method is part of the class and not part of each object created by the class.