Start of Tutorial > Start of Trail |
Search
Feedback Form |
This chapter begins with a general discussion about the life cycle of objects. The information presented applies to objects of all types and includes how to create an object, how to use an object, and how the system cleans up the object when it's no longer being used.
This chapter has been updated to reflect features and conventions of the latest release, JDK 5.0, but it is not yet final. We've published this preliminary version so you can get the most current information now, and so you can tell us (please!) about errors, omissions, or improvements we can make to this tutorial.
Next, this chapter explains how to use the core classes and built-in support for character data, numeric data, and arrays. It covers the following topics:
The Java platform groups its classes into functional packages. Instead of writing your own classes to represent character, string, or numeric data, you should use the classes that are already provided by the Java platform. Most of the classes discussed in this chapter are members of the java.lang package. All classes in the java.lang package are available to your programs automatically; there is no need for you to explicitly make them available them with an
- Character data - either a single character or a series of characters - can be stored and manipulated by one of four classes in java.lang: Character, String, StringBuilder, and StringBuffer.
- Numeric data - object representations of the primitive data types - are provided by the Number class and its subclasses. The Number class is the superclass for all number classes in the Java platform, and its subclasses in package
java.lang
include Byte, Double, Float, Integer, Long, and Short. Additionally, the BigDecimal, and BigInteger classes in packagejava.math
provide support for immutable, arbitrary-precision integer and decimal numbers.
- Arrays - for grouping multiple values of the same type into a single object - are supported directly by the Java programming language; there is no array class. Arrays are implicit extensions of the Object class, so you can assign an array to a variable whose type is declared as Object.
import
statement.
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.