Documentation

The Java™ Tutorials
Hide TOC
Numbers数字
Trail: Learning the Java Language
Lesson: Numbers and Strings

Numbers数字

This section begins with a discussion of the Number class in the java.lang package, its subclasses, and the situations where you would use instantiations of these classes rather than the primitive number types.本节首先讨论java.lang包中的Number类及其子类,以及使用这些类的实例化而不是原始数字类型的情况。

This section also presents the PrintStream and DecimalFormat classes, which provide methods for writing formatted numerical output.本节还介绍了PrintStream类和DecimalFormat类,它们提供了编写格式化数字输出的方法。

Finally, the Math class in java.lang is discussed.最后,讨论了java.lang中的Math类。It contains mathematical functions to complement the operators built into the language.它包含数学函数以补充语言中内置的运算符。This class has methods for the trigonometric functions, exponential functions, and so forth.这个类有三角函数、指数函数等的方法。


Previous page: Numbers and Strings
Next page: The Numbers Classes