O'Reilly logo

Java Programming by Hari Mohan Pandey

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

10 String and String Buffer

10.1 THE STRING CLASS

The String class represents character strings. All string literals in Java programs, such as hello,1234 and xyz123 are implemented as instances of this class. Strings are constants and their values cannot be changed after they are created. String buffers support mutable strings, i.e., which can be modified. They will be discussed in the next section. Since String objects are immutable, they can be shared.

The declaration of String class from the Java documentation is given below.

public final class String extends Object implements Serializable,
Comparable<String>, CharSequence

This states that String is a final class and object is its super class. The class implements three interfaces.

As an ...

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