OBJECT ORIENTED PROGRAMMING Flashcards

1
Q

Define the 4 main concepts of OPP.

A

Abstraction: Providing only essential information about data while hiding it’s background : implementation or details

Polymorphism: It is the abiliy for a message to be displayed in more than one form

Inheritacnce: It is when a class derives properties and methods from another class

Encapsulation: It is wrapping up data in a single unit

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

What is data hiding and modularity?

A

data hiding: it is restricting access to data and implementation details

modularity: It is an organizational software design principle where a system is divided into independent, seprerate, and cohesive components

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

what are the types of inheritance?

A

single, multiple, hierachical and multilevel inheritance

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

What is a method?

A

It is a function associated with a class

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

Why is data hiding important?

A

It protects sensitive data from being accessed or modified

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

What is a constructor and why is it important?

A

It is a special method within a class that is called when an object of that class is created.

Advatages:
* To initialiaze values fot the data members of an object
* To perform neccessar setup task for an object

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