What is OOPs concept in JAVA

Pubblicato il: 07 gennaio 2018
sul canale di: 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


In questa pagina del sito puoi guardare il video online What is OOPs concept in JAVA della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Try2Catch 07 gennaio 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 343 volte e gli è piaciuto 36 spettatori. Buona visione!