New course! Every coder should learn Generative AI!
Try a free lesson+ 4
String is a sequence of characters, for e.g. “Hello” is a string of 5 characters. In java, string is an immutable object which means it is constant and can cannot be changed once it has been created.
+ 4
Java string. Basically, string is a sequence of characters but it's not a primitive type. When we create a string in java, it actually creates an object of type string. String is immutable object which means that it cannot be changed once it is created.
+ 2
A string is an ordered sequence of characters, enclosed in double quotation marks.
It is part of the Standard Library.
You need to include the <string> library to use the string data type.