MIDTERM QUIZ1: Flashcards

1
Q

Organizes the program into logical blocks of code

A

Functions

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

the keyword _____ refers to the current instance of the class

A

this

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

an abstraction meant to represent a component of a program

A

Object

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

A multi level type of inheritance only that it overrides the same method declared in child class

A

Polymorphism

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

a type of inheritance where classes has the same parent class

A

Hierarchical Inheritance

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

TRUE OR FALSE

Multiple inheritance is described as more than one class having the same parent class.

A

False

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

TRUE OR FALSE

mutator is another term used for getters

A

False

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

TRUE OR FALSE

objects can be created, destroyed, and be given with attributes and made to perform actions

A

True

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

mutators is defined using the keyword___

A

set

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

TRUE OR FALSE

Named constructors enables a class define multiple constructors

A

True

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

A type of inheritance where a class can inherit attributes of another child class

A

Multi-level Inheritance

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

The keyword ___ is used to instantiate an object

A

new

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

This principle leads to a concept in object-oriented programming that allows a class to extend its attribute from another class.

A

Inheritance

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

TRUE OR FALSE

derived class inherits the characteristics of base class

A

True

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

allows you to access the properties of the class through interface without worrying its internal implementation

A

Abstraction

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

hides implementation details of the class

A

Encapsulation

17
Q

Also referred to as method

A

function

18
Q

used to initialize state of the object

A

constructor

19
Q

represents data pertaining to an object

A

fields

20
Q

allows an object to access fields of a class

A

getters and setters

21
Q

ENUMERATION

the 4 statement in a parameterized function is

A

An optional parameter may have a default value

Parameter values are passed to the function during its invocation.

{ } are used to specify optional paramaters

In an Optional parameterized functions, requried parameters must be declared before the optional parameters

22
Q

ENUMERATION

True about a class

A

a blueprint for instantiating an object

have attributes inherited by an object

23
Q

ENUMERATION

True about constructors

A

A constructor is a function and can be parameterized

Constructor has the same name as the class name

24
Q

ENUMERATION

True about the return type of a function

A

A function can return at most one value

if a return statement is not specified, a function returns null