What is String in Java? String is a data type?
String is a Class in java and defined in java.lang package. It’s not a
primitive data type like int and long.
Java String provides a lot of concepts that can be performed on a
string such as compare, concat, equals, split, length, replace,
compareTo, intern, substring etc.
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.
Comments
Post a Comment