OOP - MIDTERM

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

13 Terms

1
New cards

constructor

used in the creation of an object that is an instance of a class using the new keyword. Constructors are never inherited and use the name of the class and have no return type.

2
New cards

default constructor

a constructor with an empty parameter list and body. This is invisibly added to the class. It is also known as a no-argument constructor.

3
New cards

This

keyword is used when the instance variable has the same name with the constructor’s parameter.

4
New cards

Constructor overloading

occurs when constructors have different type parameters.

5
New cards

constructor chaining

When a constructor calls another constructor with a greater number of parameters, it is called _____________ This is accomplished using the this keyword too. The this() call must be the first statement in the constructor.

6
New cards

Encapsulation

describes the ability of an object to hide its data and methods.

7
New cards

accessor

a getter method is a public method that returns data from a private instance variable.

8
New cards

mutator

a setter method is a public method that changes the data stored in one or more private instance variables.

9
New cards

immutable

A class is considered _________ if it remains unchanged after an object of another class is constructed. For a class it removes the setter methods and use the constructor for setting the values.

10
New cards

Inheritance

allows a class to acquire all the attributes (fields) and behaviors (methods) of another class.

11
New cards

subclass

A class that is derived from another class is called a

12
New cards

superclass

The class from which the subclass is derived is called a

13
New cards

method overriding

You can define a new version of an existing method in a child class that makes use of the definition in the parent class. This ability is called