Oops
-
Upload
er-varun-kumar -
Category
Technology
-
view
190 -
download
0
Transcript of Oops
Page 1
OOPS Concepts in Java
By Rohit Mundra Varun Kumar Santosh Dora Shiva krishna Murali krishnan
Page 2
OOP "Object-Oriented Programming” refers to a programming methodology based on objects, instead of just functions and procedures.
1) Class2) Object3) Abstraction4) Encapsulation5) Inheritance6) Polymorphism
Page 3
Types of Inheritance
There are 5 types of inheritance as shown below.
1.Single Inheritance2.Multilevel Inheritance3.Multiple Inheritance4.Hierarchical Inheritance5.Hybrid Inheritance
Page 4
Single Inheritance
Page 5
Example of Single Inheritance
Page 6
Multilevel Inheritance
Page 7
Example of Multilevel Inheritance
Page 8
Multiple Inheritance
Java supports multiple inheritance partially through interfaces.
Page 9
Hierarchical Inheritance
Page 10
Hybrid Inheritance
Page 11
• Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. For this reason, encapsulation is also referred to as data hiding.
Encapsulation Inheritance
Page 12
Encapsulation Program
Page 13