Return to the main page Home
Learn by reading articles about Java Library
Download free Java software here Applets
Play quality Java games online Arcade
Visit our links and play the Treasure Hunt Plaza
Sample site only. Please visit http://geocities.datacellar.net/davidchan for a complete list of sites created by David Chan.

Object-Oriented Programming


Java™ is an object-oriented programming (OOP) that is based on how real world objects are made of many kinds of smaller objects. Object-oriented programming has several advantages. Some of these are making code easier to read and understand, the ability to reuse code and the reduction in development and maintenance costs.

When writing programs in an object-oriented language you define classes of objects. Classes are templates that define the variables and the methods for multiple objects with common features. Objects are software bundles of data and related procedures and are often used to model objects you find in everyday life.

Objects are the key concept to understanding object-oriented technology. Objects have state and behavior. An object maintains its state in variables and implements its behavior with methods. For example, a car object would have variables to indicate its state, eg moving at 50 km/hr and in 2nd gear. The car object would also have methods that allowed you to brake, accelerate and change gears. Anything that an object does not know or can not do is excluded from the object. Symbol

Objects provide information hiding and modularity while classes provide the benefit of reusability. Car manufacturers reuse the same blueprint over and over again to build lots of bicycles. Software programmers use the same class over and over to again create many objects.

Next article


Return to the top of the page
Top of page


| Home | Library | Applets | Arcade | Plaza |

Please send any feedback to David Chan

1