+ 1
String is an object or data type?
string
4 Answers
+ 24
String is a class in java and reference data type. String is an array of character so it is not a primitive data type.
+ 1
a string is a data type. data types are used to specify what kind of data is stored in a variable, or will be returned by a function.
+ 1
string is a data type
+ 1
String is a variable type data.so we can assign any variable to a string type.we can also have string class which have few methods which are used to manipulate string variables.
For example:-
string s;
s="ravi";
System.out.println(s.length());
Here in the output we got string length i.e, 4