Home Java Beginners OOPs and Its Concepts in Java
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

OOPs and Its Concepts in Java

Advertisement
Object Oriented Programming or OOP is the technique to create programs based on the real world.

OOPs and Its Concepts in Java

     

Brief Introduction to OOP
Object Oriented Programming or OOP is the technique to create programs based on the real world. Unlike procedural programming, here in the OOP programming model programs are organized around objects and data rather than actions and logic. Objects represent some concepts or things and like any other objects in the real Objects in programming language have certain behavior, properties, type, and identity. In OOP based language the principal aim is to find out the objects to manipulate and their relation between each other. OOP offers greater flexibility and compatibility and is popular in developing larger application. Another important work in OOP is to classify objects into different types according to their properties and behavior. So OOP based software application development includes the analysis of the problem, preparing a solution, coding and finally its maintenance.

Java is a object oriented programming  and to understand the functionality of OOP in Java, we first need to understand several fundamentals related to objects. These include class, method, inheritance, encapsulation, abstraction, polymorphism etc.

Advertisement

Class - It is the central point of OOP and that contains data and codes with behavior. In Java everything happens within class and it describes a set of objects with common behavior. The class definition describes all the properties, behavior, and identity of objects present within that class. As far as types of classes are concerned, there are predefined classes in languages like C++ and Pascal. But in Java one can define his/her own types with data and code.  

Object - Objects are the basic unit of object orientation with behavior, identity. As we mentioned above, these are part of a class but are not the same. An object is expressed by the variable and methods within the objects. Again these variables and methods are distinguished from each other as instant variables, instant methods and class variable and class methods. 

Methods -  We know that a class can define both attributes and behaviors. Again attributes are defined by variables and behaviors are represented by methods. In other words, methods define the abilities of an object. 

Inheritance - This is the mechanism of organizing and structuring software program. Though objects are distinguished from each other by some additional features but there are objects that share certain things common. In object oriented programming classes can inherit some common behavior and state from others. Inheritance in OOP allows to define a general class and later to organize some other classes simply adding some details with the old class definition. This saves work as the special class inherits all the properties of the old general class and as a programmer you only require the new features. This helps in a better data analysis, accurate coding and reduces development time. 

Abstraction - The process of abstraction in Java is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface). 

Encapsulation - This is an important programming concept that assists in separating an object's state from its behavior. This helps in hiding an object's data describing its state from any further modification by external component. In Java there are four different terms used for hiding data constructs and these are public, private, protected and package. As we know an object can associated with data with predefined classes and in any application an object can know about the data it needs to know about. So any unnecessary data are not required by an object can be hidden by this process. It can also be termed as information hiding that prohibits outsiders in seeing the inside of an object in which abstraction is implemented.  

Polymorphism - It describes the ability of the object in belonging to different types with specific behavior of each type. So by using this, one object can be treated like another and in this way it can create and define multiple level of interface. Here the programmers need not have to know the exact type of object in advance and this is being implemented at runtime.

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 21, 2006

Ask Questions?    Discuss: OOPs and Its Concepts in Java   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
manozkumar
April 19, 2011
thanks

Thanks for givin such an excellent explanation about basic concept of java
pooja
April 25, 2011
c++

I want download c++ oops
raghava
June 4, 2011
dought

hi sir/mam, i am having a dought regarding abstraction & abstract key word ? whether both r equal / different... pls explain to me...
ravi thapa
June 13, 2011
Java OOP

It you be nice if you could elaborate with structure examples.
Riyasudheen
June 20, 2011
applications of oops

its very good
kanmanichinnasamy
August 17, 2011
need better

i have viewed d concepts if example is prsnt it would be better
Om prakash
August 23, 2011
java

java reading
John
August 27, 2011
oops with example

Explain the concepts with examples.
Paul Kutosi
September 15, 2011
writing java program

it is a good site to meet with experts
s.sivaranjani
October 26, 2011
hai........

its very interesting & easy toooo ..... so friends enjoy the stuff........
eshwar
November 15, 2011
java

its good
eshwar
November 15, 2011
java

wat is java?
Boss
November 26, 2011
practice session

Hi, can anybody say me where can i get some programs as questions and answers so that i can practice myself and them i can crosscheck with the solution.... Pls help me
what is objects.
November 28, 2011
Plz send me your Ans

Plz tell me what is object in java .
durai
March 13, 2013
opps with java

oops is simple small language user to write our one thinking
why use of java in real time?
March 12, 2013
java

please give answer plz sir
malar
December 27, 2011
hai sir

in this notes is well. but this language is high level. so pls change to normal english. and pls put more information to this java concept sir
Radadya parimal M.
January 31, 2012
java

hello
naveen
June 7, 2012
java

hi to all, java is a purely object oriented programming language java supported in function overloading.its highly secured. thank u..
karmegam
July 16, 2012
oops concept

i want local author description sir \ i want simple definition sir
Doris
August 15, 2012
how can I become a programmer

i like computer program
priyesh kumar rai
August 27, 2012
oops concepts

this website is really more help full for me and every students who interested in java . every thing in define with example in this site. so this is so help full to easilly understand.
jagdish nagar
September 5, 2012
thanks to give like this progrming

thanks lot................if u have any king of service to mail me all program my email id if have then send me ................
Vgreddy
September 13, 2012
OOPS

good stuff...
vgreddy
September 13, 2012
OOPS

good stuff...
sandeepreddy
December 24, 2012
advanced java

simple and very good understand material
rani
December 5, 2012
oop

good
aysha
January 25, 2014
java

really very helping stuff for bgnrs of java