Objects


Mary Campione, inside her book The Java Tutorial, gives us this definition for an object: "An object is a software bundle of variables and related methods". This definition is based on the real life, in which every object has a state, and on an object it is possible to act in various ways.

It'll be easier to explain by an example: we could think to a radio. The state of a radio could be described by the position of its on-off button, by the position of its turning knob, by the position of its volume knob, and moreover, by the shape of the radio, by its colour, by the height of its antenna, etc. On a radio you can do various actions: to turn on, to turn off, to tune in, to chose a volume, etc. Some action needs additional informations to be executed: saying "turn the volume knob" is meaningless, it's better to say "turn the volume knob of 90 degrees by clockwise" or "fix the volume to 50% of maximum". Additional informations needed are called parameters, like functions parameters in mathematics.


Index           Home  Back       About  Contact us!

Copyright (c) 1998-2006 Wowarea