What is Java Documentation Of Teh String Class?
The Java String
class represents a sequence of characters and is part of the java.lang
package. It is immutable, meaning once a String
object is created, it cannot be changed. Common methods include length()
, charAt(int index)
, substring(int beginIndex, int endIndex)
, indexOf(String str)
, and equals(Object obj)
. The class also supports concatenation and enables comparison of strings. Strings can be created using string literals or by instantiating a String
object directly. The String
class also provides various utility methods for string manipulation and searching.