Computer Applications
Which of the following methods belong to the String class ?
- length()
- compareTo()
- equals()
- substring()
- All of these
- None of them
Java String Handling
8 Likes
Answer
All of these
Reason — All of the given methods belong to the String class.
Answered By
5 Likes
Related Questions
A String object cannot be modified after it is created. (T/F)
The length of a String object s1 can be obtained using the expression s1 length. (T/F)
Given the code
String s1 = "yes" ; String s2 = "yes" ; String s3 = new String(s1) ;Which of the following would equate to False ?
- s1 == s2
- s3 == s1
- s1.equals(s2)
- s3.equals(s1)
Suppose that s1 and s2 are two strings. Which of the statements or expressions are incorrect ?
- String s3 = s1 + s2;
- String s3 = s1 - s2;
- s1.compareTo(s2);
- int m = s1.length( );