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 / bhaskara reddy akepati

Abstraction:
Hiding unnecessary things and showing the essential
information.

Example: Suppose take a car: In that we will have breaks
and stering and etc... Here when we are changing the gear
box to up or bottom then gears will work but we don't know
how they are managing internally and we don't no how it is
working. As a driver we don't need to know how it is
working internally when we are changing every time. That is
the reason they will hide the wires and cables internally
and they will show up only gear box to us.

Advantages: 1) Code will be clean and for managing it will
be very easy

Inheritance:

Acquiring the properties from super class to
subclass.

Example: Suppose take two java classes
Class A contains 2 variables and ClassB Extends Class A
that means here ClassB can access the classA variables
without declaring it. If we do this then the memory will be
less and reusable.

Advantages: 1)Reusability of code

Encapsulation: Wrapping up of data and methods into a
single unit.

Example: In our class we need to make all our varables and
methods keeping together.

Advantage: Maintance will be good

Polymorphism: It means many forms.
2 types:
1) Compile time polymorphism
2) Run time polymorphism

Method overloading is an example for Compile time
polymorphism and
Method overriding is an example for Run time polymorphism

Is This Answer Correct ?    24 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mean by encoding?

1043


What is the default value of an object reference declared as an instance variable?

1068


What is an off by one error in java?

918


Is arraylist ordered in java?

1053


What is square root in java?

1052


How many bits is a boolean?

1050


write a program that list all permutations of ABCDEF in which A appears before B?

2446


What is the use of hashmap in java?

1036


What is 16 bits called?

904


What is byte [] in java?

967


What is a for loop in java?

1009


Can a static method be overridden in java?

982


What about instanceof operator in java?

980


What do you understand by the term string pool?

972


Can we override final method?

954