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

Answer Posted / nagur dethri

in java there are four main concepts which are back_bone to
java,they are.
ABSTRACTION,
ENCAPSULATION,
INHERITANCE,
POLYMORPHISM.
ABSTRACTION:Simply,abstraction means showing
essentialthings and hiding non_essential or un_neccessary
things.
Eg:many people want to drive different types of cars with
variety styles.here,we are hiding the inner side design
(i.eengine battery,sound system wirings etc.,i.e
non_essential)but we are showing (sound system,remote
system to operate those systems).
ENCAPSULATION:combing of both data and methods.
eg:simply in java language,in an single class we are using
or combing both instance variables and methods.
POLYMORPHISM:it is an ability to take more than one form.
eg:STUDENT,a student is acting like a student in college
camplus,and also acting as an employee in part time job and
acting as an daughter/son in homes.
INHERITANCE:in java,deriving a new class from an old class
(i.e,already existing one) or simply new or derived or
super class acquiring the properties of old class or base
or sub class.
eg:as_usual,CHILD AND PARENT RELATIONSHIP i.e,jeans
(daughter or son getting the fetures of his/her parents).

THANK YOU.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What package is math in java?

526


What is off heap memory?

540


How to check if a list is sorted in java?

580


What do you mean by mnemonics?

521


Is array primitive data type in java?

525






What is the difference between a field variable and a local variable?

560


Does treeset use compareto?

530


Can we declare the main method of our class as private?

544


How do you sort a string in java?

529


How will you initialize an Applet?

612


Define how destructors are defined in java?

578


Can a main method be overloaded?

563


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

620


What is type safety in java?

478


Difference between nested and inner classes ?

595