Object Oriented Programming Stuctures:
It is a programming methodology in which the programs are organized as collections of objects.Each object represents an instance of some class.The classes can be interrelated to each other through inheritance
OOPS revolves around these concepts:
1)Code reusability: define a class and n number of objects implement the class
logic: example: Button class and n number of Button objects
2)Inheritance : Eliminates redundant code and extend the use of existing classes.
example: 1)we can create our own TextBox by inheriting from the TextBox class.
2)We can inherit one Windows Frorm into another.
3)Encapsulation: The programmer can hide the data and functions in a class from other classes.It is accomplished through modifiers like private, protected,
4)Easy to Maintain and Upgrade:
If we want to make changes in a class, we can make them and save the changes in the .dll This .dll can easily be updated in the client by using Update Reference.
5)Polymorphism provides us with methods extensibility.
we can have different methods with same name, but with different kinds of behavior
6)Abstraction allows us to define a common definition of a base class
that multiple derived classes can share.
create an abstract class bank with simple interest function
This function will be implemented in the derived classes of
the bank class.
ex: 1)icici class will have its own simple interest.
2)ABC class will have its own simple interest.
icici and ABC both are child classes of bank class.
Asked In: Many Interviews |