Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what are the oops concept in java explain with real time
examples

Answer Posted / ramya

1)Abstraction:

Abstraction is a way to remove the association of the
behavior of an object with the actual details behind the
scenes which implement that object's behavior. This
'abstraction' is usually accomplished through the use of
base classes with virtual functions; each derived function
provides the details that implement the behavior behind that
abstraction.

eg/we invented flight based on the mechanism of Birds. So
flight is derived form the base of birds.

2)Encapsulation:

It is a process of binding or wrapping the data and the
codes that operates on the data into a single entity. This
keeps the data safe from outside interface and misuse. One
way to think about encapsulation is as a protective wrapper
that prevents code and data from being arbitrarily accessed
by other code defined outside the wrapper.

eg/ Ink is the important component in pen but it is hiding
by some other material

3)Polymorphism:

a single function or single operator has different character
in different place.

eg/A girl plays a role of daughter at home and a manager at
office

4)Inheritance:

The new classes, known as derived classes, take over (or
inherit) attribute and behavior of the pre-existing classes,
which are referred to as base classes (or Parent classes).
It is intended to help reuse existing code with little or no
modification.

eg/ parent-child relation

Is This Answer Correct ?    190 Yes 63 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can constructor return value?

950


What is a constructor, constructor overloading in java?

994


Difference between ‘>>’ and ‘>>>’ operators in java?

1117


What are constructors in java?

1096


What is the common usage of serialization? What exceptions occur during serialization?

1107


Why we used break and continue statement in java?

1127


What are constants and how to create constants in java?

979


What is boolean used for?

1018


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1936


Can constructor be static or final?

1083


What do you mean by scope of variable?

884


What is user defined exception in Java?

1067


What is singleton class in ruby?

1002


Is there a jre for java 11?

1070


What is the difference between processes and threads?

1044