A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

String Handling

What is String Handling in Java

What is String Handling in Java ?

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);