C H A P T E R  2

image

Strings

Strings are one of the most commonly used data types in any programming language. They can be used for obtaining text from a keyboard, printing messages to a command line, and much more. Given the fact that Strings are used so often, there have been many features added to the String object over time in order to make them easier to work with. After all, a String is an object in Java, so it contains methods that can be used to manipulate the contents of the String. Strings are also immutable in Java, which means that their state cannot be changed or altered. This makes them a bit different to work with than some of the ...

Get Java 7 Recipes: A Problem-Solution Approach 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.