Encapsulation And Inheritance Flashcards

1
Q

define encapsulation

A

the process of wrapping data and functions together as a unit

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

how can encapsulation be made possible

A

by declaring the class members as private

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

private visibility supports what

A

data hiding, as once data members are declared private, their accessibility remains limited up to the class block

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

define scope of variable

A

refers to the extent of their usage in a program

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

define instance variables

A

the variables that are declared within a class, outside the member methods. AKA data members
they are automatically allocated as individual copy of each object of the class

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

scope of use of private

A

within the scope of class

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

scope of usage of public

A

accessed outside of class visibility

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

scope of usage of protected

A

used simply as private members within the class in which they exist, but can be accessed to derived class

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

define class variable

A

declared within the class along with a keyword static .
AKA static data member

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

difference between static and non static instance variable

A

static: common copy for all objects of the class
non static: separate copy for all objects

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

define local variable

A

a variable that is declared within a function or method
hold values temporarily during any operation

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

define inheritance

A

a process by which some properties of a class are shared by another class or classes is known as inheritance

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

define base class and derived class

A

a base class is inherited by another class
a derived class or Target/ sub class inherits from a base class

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

types of inheritance

A
  1. single inheritance
  2. multiple inheritance
  3. hierarchical inheritance
  4. nested/multilevel inheritance
  5. hybrid inheritance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly