The JavaTM Tutorial

| Start of Tutorial > Start of Trail | Search Feedback Form

Trail: Learning the Java Language

## Lesson: Object Basics and Simple Data Objects

This trail 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 it, and, finally, how the system cleans up the object when it's no longer being used.

### The Life Cycle of an Object

> Here, you will learn how to create and use objects of any type. This section also discusses how the system cleans up the object when it's no longer needed.

### Characters and Strings

> Character data--either a single character or a series of characters--can be stored and manipulated by one of three classes in `java.lang`: `Character`, `String`, and `StringBuffer`.

### Numbers

> To work with numeric data, you use the number classes. The `Number` class is the superclass for all number classes in the Java platform. Its subclasses include `Float`, `Integer`, and so on.

### Arrays

> An array is an important data structure in any programming language. An array is a fixed-length structure that stores multiple values of the same type. You can group values of the same type within arrays. Arrays 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`.

> The Java platform groups its classes into functional packages. Instead of writing your own classes, you can use one provided by the platform. Most of the classes discussed in this chapter are members of the `java.lang` package. All the classes in the `java.lang` package are available to your programs automatically.

| Start of Tutorial > Start of Trail | Search Feedback Form

Copyright 1995-2001 Sun Microsystems, Inc. All rights reserved.