What is String in java ?
A sequence of characters is called as String. But in case of  java, string is an object which represents a sequence of characters. String class is used for creation of string object.

How to create String object ?
To create String object there are two ways :-
By string literal.
By new keyword.

 Which constructor is used to create an empty String object ?
String().

Which method of class String is used to extract a single character
from a String object ?
charAt().

What is a StringBuffer class and in what way  it differs from String class?
StringBuffer is a peer class of String that provides relatively all the functionality of a string. String  represents  immutable character sequences, fixed-length, and StringBuffer represents, growable, mutable and writeable character sequences. But StringBuffer doesn’t create new instances as string so it is more efficient when it comes to intensive concatenation operation.

When you add a double value to a String  what happens ?
The result is a String object.

Write the difference  between StringBuffer and StringBuilder   class ?
The differences are given below:
1. StringBuffer is thread-safe but StringBuilder is not thread safe.
2. StringBuilder is faster than StringBuffer.
3. StringBuffer is synchronized whereas StringBuilder is not synchronized.

 What is toString() method in Java ?
This method i.e. toString() returns the string representation of any object.

How to make a class immutable in java ?
To make a class immutable do the following things:
1. Make a class final or private.
2. Remove constructor.
3. Allow only getter method in a class.

String is Thread Safe or not ?
Yes, because String object are immutable that’s why String is thread safe.