New to JavaProgramming Center
Java Platform Overview |
Getting Started |
Step-by-Step Programming
![]()
Contents Do you think there is a limit to how many objects make up an application?
There are no limits on how many objects you can create for an application.
The number of objects an application instantiates, or puts into memory, depends entirely on the requirements of the application. The point to keep in mind about classes and objects is that the class is the plan, and the object is the plan with all the details filled in and put into memory. In other words, the object is the actual button a user clicks rather than the instructions or class that specifies button size or function. ClassesThe classes that are a part of the Java J2SETM download are complete, predefined classes you can use in your applications. These predefined classes provide features frequently used in creating applications, such as writing to and reading from files, creating graphical components like buttons and menus, and making Web pages interactive. To create an application, though, you need to define your own classes as well as using predefined classes from the Java library. Your own classes provide the instruction for how you want the application built, and the predefined class you use define many components of the application, premade objects, such as buttons, menus, fonts, colors, and more. When you define a class, you are planning how the object created from that class is going to appear and behave. A class contains:
There'll be more on fields and methods later. For now, look at some kinds of classes you'll write to create objects for the Dive Log. First, you'll need a frame for the application. Other components of the application are organized into tabbed panes. Each of those tab objects has white text and the background color blue. Later, you'll learn what goes on each pane and how to develop those objects. For now, you'll learn about frame and tab objects.
You will start with designing a few objects (the frame and tabs), then build on those classes as you progress through the lessons.
Every class in the Dive Log starts with: package divelog;
| ||||||||||
|
| ||||||||||||