9. Numbers and Strings

Chapter Contents

Numbers

Characters

Strings

This chapter begins with a discussion of the Number class (in the java.lang package) and its subclasses. In particular, the first section talks about the situations where you would use instantiations of these classes rather than the primitive data types. Additionally, this section talks about other classes that format the output of numbers and perform more complex mathematical functions. Finally, there is a discussion on autoboxing and unboxing, a compiler feature that simplifies your code. The second section discusses characters, and the third section discusses strings, which are a sequence of characters and widely used in Java programming. In the Java programming language, ...

Get The Java® Tutorial: A Short Course on the Basics, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.