|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
This section begins with a discussion of theNumberclass in
java.langand its subclasses. In particular, this section talks about why you might need these classes, points out the common methods and class variables they have in common, and shows you how to convert instances to strings.
Additionally, this section talks about other classes you might need to work with numbers. For instance, if you need to display a number in a particular format, you can use the
NumberFormatand
DecimalFormatclasses in
java.textto format them. If you are using JDK 5.0 or later, theprintffacility ofPrintStreamprovides a convenient method for writing a formatted string to an output stream. Also, the
Mathclass in
java.langcontains class methods that perform mathematical functions beyond those provided by the language. This class has methods for the trigonometric functions, exponential functions, and so on.
|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.