OOP Flashcards
Difference between Procedural programming and OOPs?
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.
Why use OOPs?
It has flexibility and simplicity in solving complex problems.
What are the basic concepts of OOPs?
Abstraction, Encapsulation, Inheritance, Polymorphism
What is Encapsulation?
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.
What is Abstraction?
Abstraction is an OOPs concept where you while constructing your objects you “shows” only essential attributes and “hides” unnecessary information from the outside.
What is method overloading?
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
What is method overriding?
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.