3. Object Oriented Programming
● OOP was introduced to overcome flaws in the
procedural approach to programming.
● Such as of reusability & maintainability.
● It ties data more closely to the functions that
operate on it, and protects it from accidental
modification from outside functions.
● OOP allows decomposition of a problem into a
number of entities called objects
5. Concept of Oops
● Classes
● Objects
● Data Encapsulation
● Data Abstraction
● Inheritance
● Polymorphism
6. Class & Object
● A class is collections of objects of similar type.
● C# is the primary building block of language.
It mean’s to work with C# you have to create classes to
make a program. You can use classes as a template.
Object -
● It is a instance of a class.
● Any real world entity present in the world.
7.
8.
9. Features of Oops
● Encapsulation
● Data Abstraction
● Inheritance
● Polymorphism
10. Encapsulation
● The wrapping up of data and functions into a single
unit is known as Encapsulation
● The data is not accessible to the outside world and
only those functions which are wrapped in the class
can access it.
● This insulation of the data from direct access by the
program is called data hiding or information hiding.
11. Data Abstraction
● Abstraction is the process of hiding the details and
exposing the details and exposing the essential
features of the particular concept.
● Abstraction refers to the act of representing essential
features without including the background details or
explanations.
12. Inheritance
● Inheritance is the property to which a child class
obtain all the features define in it parents class.
Ex- A child can inherit the generatic properties of
his parents
● In OOP the concept of inheritance provides the idea
of reusability.
● This means that we can add additional features to
an existing class without modifying it.
13.
14. Types of Inheritance
● Single Inheritance
● Hierarchical Inheritance
● Multilevel Inheritance
● Multiple Inheritance
Class A
Class B
15. Polymorphism
● Polymorphism is a Greek Term which means ability
to take more than one form.
● For Example + is used to sum of two numbers as
well as it is used to combine two strings
Operator +
2+3=5 ‘mno’+’pqr’
16. Types Of Polymorphism
● These are two types-
1.Compile Time Polymorphism
2.Run Time polymorphism
17. Compile Time Polymorphism
● Also known as (Overloading ,Static)
When the Compiler compile a program the compiler
because the information about the method argument
and accordingly the compiler finds the appropriate
method to the object and the compile time key.
19. Run-Time Polymorphism
● Overriding is the feature provided by Oops the
allows a derived class to produce a specific
implementation of a method the is already provides
by its base class.
● We use virtual and override keywords.
20. Benefits of Oops
● Reuse of code through inheritance.
● Flexibility through polymorphism.
● Effective problem solving.
● The principle of data hiding helps the programmers to built
secure program that can’t be invaded by code in other parts
of the program.
● Object-oriented systems can be easily upgraded from small
to large system
● Software complexity can be easily managed.