OOP Flashcards

1
Q

Difference between Procedural programming and OOPs?

A

Procedural Programming: is based on functions.

  • It shows the data to the entire program.
  • It does not have scope for code reuse.
  • It is hard to modify, extend and maintain the code.

Object-oriented programming:

  • It encapsulates the data.
  • It provides more scope of code reuse.
  • It is less complicated in nature, so it is easier to modify, extend and maintain.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why use OOPs?

A

It has flexibility and simplicity in solving complex problems.

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

What are the basic concepts of OOPs?

A

Abstraction, Encapsulation, Inheritance, Polymorphism

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

What is Encapsulation?

A

Encapsulation is also a part of OOPs concept. It refers to the bundling of data with the methods that operate on that data. It also helps to restrict any direct access to some of an object’s components.

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

What is Abstraction?

A

Abstraction is an OOPs concept where you while constructing your objects you “shows” only essential attributes and “hides” unnecessary information from the outside.

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

What is method overloading?

A

There is a concept where two or more methods can have the same name. But they should have different parameters, different numbers of parameters, different types of parameters, or both

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

What is method overriding?

A

It is a language feature that allows a subclass or child class to provide a specific implementation of a method which is already provided by one of its super classes or parent classes.

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