String is a Class in java and defined in java.lang package. It’s not a primitive data type like int and long. String class represents character Strings. String is used in almost all the Java applications and there are some interesting facts we should know about String. String in immutable and final in Java and JVM uses String Pool to store all the String objects.
Some other interesting things about String is the way we can instantiate a String object using double quotes and overloading of “+” operator for concatenation.
String is a sequence of characters. String is a class in java.
String a="Hello java";
In above statement "a" is object reference and "Hello java" is a string literal. String is used as a data type in java.