• Register

Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.


+1 vote

What is String in Java? Is String is data type?

I want to know deep idea about java string. So, please help me in deeply.

in Java by

1 Answer

+1 vote

String is not primitive data type like int, long or double. String is a class or in simple world you can say user defined type. String is a Class which is defined in java.lang package and wrappers its content in a character array. String in immutable and final in Java and JVM uses String Pool to store all the String objects. String object using double quotes and overloading of “+” operator for concatenation.

String provides equals() method to compare two String and some other methods like toUpperCase() to convert String into upper case, replace() to replace String contents, substring() to get substring, split() to split long String into multiple String.

The eight primitive data types are: byte, short, int, long, float, double, boolean, and char. The java.lang.String class represents character strings.

by (3.2k points)
It is very nice answer about java string. I got basic information about java string.