OOP Flashcards

1
Q

What is OOP?

A

Object Oriented Programming is a programming paradigm based on the concepts of objects. These objects contain data in form of fields and procedures in form of methods.

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

4 basic principles of OOP

A

Encapsulation
Abstraction
Inheritence
Polymorphism

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

Encapsulation

A

It is a mechanism of restricting access to certain details of the object and only exposing the necessary parts through public methods.

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

Abstraction

A

Involves hiding the complex implementation details of a system and exposing only the essential features. It allows you to focus on what an object does rather than how it does it.

Done using Abstract classes and Inteface

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

Inheritance

A

Allows a new class (derived class or child class) to inherit properties and methods from an existing class (base class or parent class). This promotes code reuse and establishes a natural hierarchy between classes.

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

Polymorphism

A

Allows objects of different classes to be treated as objects of a common superclass. It is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.

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

Access Modifiers

A

Private - same file
Protected - derived classes any assembly
Internal - same assembly
Public - whole code base
Private Protected - derived classes same assembly
Protected Internal - same assembly and any derived classes

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