Professional Documents
Culture Documents
String is the datatype that defines and support the character strings. In java strings are object.
The string “in java, strings are objects” are automatically made into a string object by java.
Constructing an string
We can construct the string by using the new and calling the string constructor
Here, str is initialized to the character sequence “java strings are powerfull”
Class stringDemo
System.out.println(str1);
System.out.println(str2);
System.out.println(str3);
}
}
Output:
System.out.println( str.length() );