chapter 5, 6 and 7: oop finals Flashcards

1
Q

The meaning of ___________ is to make sure that “sensitive” data is hidden from users.

A

ENCAPSULATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

It enables the use of existing class to define a new class.

A

Java Enheritance/Enheritance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A derived class is defined by adding instance variables and methods to an existing class. It
is also known as ________, __________, and __________.

A

subclass, child class, and descendant class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The existing class that the derived class is built upon is called the _________. It is also called
superclass, parent class, and ancestor class.

A

base class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The derived class is _______ while the base class is _______.

A

Student, Person

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The ________ class inherits the declared instance variables and public methods in the _________ class except its constructor.

A

Student, Person

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A derived class has its own _________. It does not inherit any constructors from the base class.

A

Constructors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An __________ is an event that occurs during the execution of a program that disrupts the normal flow of instructions.

A

Exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

It is the process used to change the normal flow of code execution if a specified exception occurs.

A

Exception handling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Exceptions that occur during compilation are called _______________.

A

Checked exceptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

________________ are exceptions that occur during execution. These are also known as ___________.

A

Unchecked exceptions, runtime exceptions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A ____________ is a block of code that might throw an exception that can be handled by a matching catch block.

A

Try block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A ____________ is a segment of code that can handle an exception that might be thrown by the try block that precedes it

A

Catch block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Only _______ try block is accepted in a program but there can be multiple catch blocks.

A

One (1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The _________ contains statements which are executed whether or not an exception is thrown.

A

Finally block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

OOP stands for

A

Object-Oriented Programming

17
Q

Java code DRY stands for?

A

“Don’t Repeat Yourself”

18
Q

It is a collection of statements that are grouped together to perform an operation.

A

Method

19
Q

Keywords that can be used to control the visibility of fields, methods, and constructors in a class. The four access modifiers in Java are public, protected, default, and private.

A

Access Modifier

20
Q

Four Types of Access Modifiers

A

Private, Default, Protected, Public

21
Q

Can access the _______ modifier only within the same class and not from outside the class.

A

Private

22
Q

Can access the default modifier only within the same package and not from outside the package. And, if they do not specify any access modifier it will automatically consider it as __________.

A

Default

23
Q

Can access the protected modifier within the same package and also from outside the package with the help of the child class. If they do not make the child class, they cannot access it from outside the package. So, inheritance is a must for accessing it from outside the package.

A

Protected

24
Q

Can access the public modifier from anywhere. Can access _______ modifiers from within the class as well as from outside the class and also within the package and outside the package.

A

Public

25
Q

_____________ causes the program control to transfer back to the caller of a method. Every method in Java is declared with a return type and it is mandatory for all java methods. A return type may be a primitive type like int, float, double, a reference type or void type (returns nothing).

A

Return Statement

26
Q

Same rule of naming a variable.

A

Method Name

27
Q

A ___________ is like an object constructor, or a “blueprint” for creating objects.

A

Class

28
Q

Classes and objects are the two main aspects of object-oriented programming.

A

Class and Objects

29
Q

A __________ is a special method that is used to create and initialize an object.

A

Constructors