What is String Handling in Java ?
Java String Handling
String Handling in Java(Introduction):
A string is a sequence of characters.
The String objects are immutable(constant), it means their values cannot be changed after they are created.
Once a String object is created, the characters that comprise the String object will be created but original contents of the object will not changed.
String buffers support mutable strings.
Because String objects are immutable they can be shared.
Object Creation of String: String str = new String();
Let see for Example:
String s=“HeeraBabu”;
It is equivalent to:
char name[] = {‘H,’e’ ,’e’ ,’r’ ,’a’ ,’B’ ,’a’ ,’b’ ,’u’};
String s=new String(name);