Your SlideShare is downloading. ×
Oops
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Oops

297
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
297
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ObjectivesOn completion of this period, you would be able to know :• JVM• OOP concepts 1
  • 2. OOP ConceptsThe OOP Concepts are• Encapsulation• Inheritance• Polymorphism 2
  • 3. Encapsulation• The wrapping up of data and methods into a single unit is known as Encapsulation• The data is not accessible to the outside world and only those methods, which are wrapped in the class can access it• The insulation of the data from direct access by the program is called “ Data Hiding” 3
  • 4. Inheritance• Inheritance is the process by which objects of one class acquire the properties of objects of another class• Inheritance provides the idea of reusability• We can add additional features to an existing class without modifying it• The original class is called as base class• The inherited classes are called as sub classes 4
  • 5. Inheritance ShapeCircle Rectangle Triangle Fig. 4.3 Inheritance 5
  • 6. Inheritance• In the Fig. 4.3 Shape is the base class• Circle, Rectangle and Triangle are classes that are inherited 6
  • 7. Polymorphism• Polymorphism is another feature of OOP concept• ‟Poly‟ means „many‟, ‟Morph‟ means „forms‟• “Polymorphism means the ability to take more than one form” 7
  • 8. Polymorphism• Allows a method to have multiple implementations that are selected based on which type of object is passed 8
  • 9. Polymorphism •Current object is circle • method draw() is called Shape draw()Circle Rectangle Triangledraw() draw() draw() Fig. 4.4 Polymorphism 9
  • 10. Polymorphism •Current object is Triangle •Method draw() is called Shape draw()Circle Rectangle Triangledraw() draw() draw() Fig. 4.5 Polymorphism 10