O'Reilly logo

Java, A Beginner’s Guide, 5th Edition by Herbert Schildt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Strings

From a day-to-day programming standpoint, one of the most important of Java’s data types is String. String defines and supports character strings. In many other programming languages a string is an array of characters. This is not the case with Java. In Java, strings are objects.

Actually, you have been using the String class since Chapter 1, but you did not know it. When you create a string literal, you are actually creating a String object. For example, in the statement

Image

the string “In Java, strings are objects.” is automatically made into a String object by Java. Thus, the use of the String class has been “below the surface” in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required