Introducing Strings

String handling in C or C++ (the languages that inspired Java) is infamously clunky. Java solves that problem the same way many C++ programmers do: by creating a String class. Java's String class enables your programs to manage text strings effortlessly, using statements similar to those used in simpler languages, such as BASIC or Pascal.

You can probably find many instances of the String class in most Java applications, especially business type applications. They are used extensively. So, what exactly is a Java String class anyway? In its simplest form, a string is nothing more than one or more text characters arranged consecutively in memory. You can think of a string as an array of characters, with this array having an ...

Get Special Edition Using Java 2 Standard Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.