Beginning Java Objects: Chapter 3 Objects and Classes
Instantiation
A class definition may be thought of as a template for creating software objects — a 'cookie cutter' used to:
- Stamp out a prescribed data structure in memory to house the attributes of a new object.
- Associate a certain set of behaviors with that object.
The term instantiation is used to refer to the process by
which an object is created/constructed based upon a class
definition. From a single class definition — for example,
Student — we create many objects/instances of
the class, in the same way that we use a single cookie cutter to
make many cookies. Another way to refer to an object, then, is as
an instance of a particular class. We'll talk about the
physical process of instantiating objects as it occurs in
Java in a bit more detail later in this chapter.
Classes may be differentiated from objects, then, as follows:
- A class defines the attributes — names and data types — that all objects belonging to the class
must possess, and the methods that all objects belonging to the class must be able to perform,
and can be thought of as an empty template.
- An object, on the other hand, is a filled-in template to which attribute values have been provided.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|