What is OOPs concept in JAVA

Published: 07 January 2018
on channel: Try2Catch
343
36

OOPs Concept

Inheritance: When one object acquires all the properties and behaviors of parent object i.e. known as inheritance. It provides code re usability.

Inheritance having two types (Inheritance) IS-A and (Composition) HAS-A:

IS-A: This relationship is easy to identify. In real world, car is a vehicle. Car extends all the properties of vehicle and implements vehicle’s behavior. In java world, where ever extends and implements keyword is used with class name, defines IS-A relationship.

This relationship is uni-directional. Means, Car is vehicle but a vehicle never be a car.

HAS-A: In real world, car has AC, stereo etc from car accessories. In java world, when any instance variable use in some other class known as HAS-A relationship.

Poly morph-ism: It is very simple to understand, one name but many forms. Like in real world, we have bicycles. But, there are so many types of them. Only having little changes and there functionality is totally changed just because of some of having gear, light, GPS etc. In java world, overloading and overriding are example of poly morph-ism.

Encapsulation: This is known as binding or wrapper data together into a single unit. The best and simple example is capsule, having different type of medicine into a single capsule. In java world, bean class is best example of encapsulation. All the members are in a single class and all are private.


Abstraction: Hiding internal details and showing functionality is known as abstraction. Like we have car we always drive but don’t know how it starts. In java world, we use abstract classes and interface to implement abstraction.

Facebook :   / try2catch  
Blog : http://trycatch55.blogspot.in
WhatsApp- http://bit.ly/31ZdBM1


On this page of the site you can watch the video online What is OOPs concept in JAVA with a duration of hours minute second in good quality, which was uploaded by the user Try2Catch 07 January 2018, share the link with friends and acquaintances, this video has already been watched 343 times on youtube and it was liked by 36 viewers. Enjoy your viewing!