Computer Applications
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( );
Related Questions
Which of the following methods belong to the String class ?
- length()
- compareTo()
- equals()
- substring()
- All of these
- None of them
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)
Given the code :
String s = new String("abc");Which of the following calls are invalid ?
- s.trim( )
- s.replace('a', 'A')
- s.substring(3)
- s.toUpperCase( )
- s.setCharAt(1, 'A')
Which of these class is superclass of String and StringBuffer class?
- java.util
- java.lang
- ArrayList
- None of the mentioned