Java Reference
In-Depth Information
8
Strings, StringBuffers,
StringBuilders, Numbers,
and BigNumbers
In This Chapter
Strings
Comparing Strings
Working with Strings
Numeric Wrapper Classes
StringBuffers
BigNumbers
Exercises: Strings, StringBuffers, Numbers, and BigNumbers
Reviewing the Exercises
This chapter explores text manipulations and number-related classes and methods.
S TRINGS
Java provides a String class that developers can use to hold and manipulate charac-
ter strings (that is, a sequence of chars). The COBOL developer may recognize
String s as the equivalent of the PIC X(x) definition, and they are generally similar.
However, Java's native String handling functions are far superior to COBOL's no-
toriously weak character manipulation support. Further, String s are real objects,
and so some differences naturally exist. Java String s contain 16-bit Unicode charac-
189
Search WWH ::




Custom Search