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

Answer Posted / m arunachalam

OOPS COncepts Are:
Mainly these are the concepts are very important in oops:
Abstraction
Encapsulation
Inheritance
Polymorphism.

Birds Vs Abstractions

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

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.

Pen Vs Encapsulation

Pen: Ink is the important component in pen but it is hiding
by some other material

Encapsulation: 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.

Crocodile Vs Polymorphism

Crocodile: live indifferently on land or in the water. In
water it’s Moment very fast compare to land. An animal lives
in different character in different place.

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

Inheritance Vs Human Relationship

Human Relationship: GrandFather-Father-Son

Inheritance:A derived from existing one to new one is known
as Inheritance.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between overloading and overriding in java?

529


Explain the difference between intermediate and terminal operations in java8?

568


Explain the difference between comparator and comparable in java?

484


Which number is denoted by leading zero in java?

811


Java Compiler is stored in JDK, JRE or JVM?

1052






Does .length start 0 java?

569


What is pojo class in java?

538


Why is singleton instance static?

506


Why object class is super class for every class in java?

575


What are different types of arrays?

534


What is a generic data type?

574


What is hashset in java?

530


What is the final class modifier?

561


What do you mean Abstraction in java?

611


What does string intern() method do?

589