CS Awesome - Unit 9 Vocabulary

studied byStudied by 3 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 15

flashcard set

Earn XP

Description and Tags

Inheritance

16 Terms

1

object

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

New cards
2

class

A class defines what all objects of that class know (fields) and can do (methods). You can also have data and behavior in the object that represents the class (class fields and methods). All objects of a class have access to class fields and class methods, but these can also be accessed using className.field or className.method().

New cards
3

inheritance

One class can inherit object fields and methods from another. This makes it easy to reuse another class by extending it (inheriting from it). This is called specialization. You can also pull out common fields and/or methods from several related classes and put those in a common parent class. This is called generalization.

New cards
4

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 complied.

New cards
5

parent class

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

New cards
6

child class

The class that is doing the inheriting is called the child class. It inherits access to the object fields and methods in the parent class.

New cards
7

subclass

A child class is also called a subclass.

New cards
8

superclass

A parent class is also called a superclass.

New cards
9

declared type

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

New cards
10

run

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

New cards
11

overrides

A child class can have the same method signature (method name and parameter list) as a 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, so the child method overrides the parent method.

New cards
12

overload

At least two methods with the same name but different parameter lists. The parameter lists can differ by the number of parameters and/or the types.

New cards
13

getter

A method that returns the value of a field in an object.

New cards
14

setter

A method that sets the value of a field in an object.

New cards
15

accessor

Another name for a getter method - one that returns the value of a field.

New cards
16

mutator

Another name for a setter method - one that changes the value of a field.

New cards

Explore top notes

note Note
studied byStudied by 22 people
712 days ago
5.0(1)
note Note
studied byStudied by 40 people
827 days ago
5.0(1)
note Note
studied byStudied by 27 people
875 days ago
5.0(1)
note Note
studied byStudied by 32 people
898 days ago
5.0(2)
note Note
studied byStudied by 4 people
661 days ago
5.0(1)
note Note
studied byStudied by 35 people
645 days ago
4.0(1)
note Note
studied byStudied by 35 people
349 days ago
5.0(1)
note Note
studied byStudied by 15448 people
658 days ago
4.8(60)

Explore top flashcards

flashcards Flashcard (84)
studied byStudied by 20 people
417 days ago
5.0(2)
flashcards Flashcard (82)
studied byStudied by 10 people
744 days ago
5.0(3)
flashcards Flashcard (115)
studied byStudied by 93 people
640 days ago
5.0(1)
flashcards Flashcard (153)
studied byStudied by 10 people
49 days ago
5.0(1)
flashcards Flashcard (55)
studied byStudied by 156 people
418 days ago
5.0(1)
flashcards Flashcard (29)
studied byStudied by 3 people
113 days ago
5.0(1)
flashcards Flashcard (60)
studied byStudied by 76 people
269 days ago
5.0(1)
flashcards Flashcard (34)
studied byStudied by 55 people
308 days ago
5.0(2)
robot