MCQs
Total Questions : 29
| Page 3 of 3 pages
Answer: Option D. -> length()
Method length() of string class is used to get the length of the object which invoked method length().
Answer: Option B. -> trim()
None.
Answer: Option A. -> startsWith()
Method startsWith() of string class is used to check whether the String in question starts with a specified string. It is specialized form of method regionMatches()
Method startsWith() of string class is used to check whether the String in question starts with a specified string. It is specialized form of method regionMatches()
Answer: Option D. -> regionMatches()
None.
None.
Answer: Option A. -> +
operator + is used to concatenate strings, Example String s = "i " + "like " + "java", String s contains
"I like java".
Answer: Option A. -> substring()
None.
Answer: Option B. -> java.lang
None.
Answer: Option A. -> equals()
None.
Answer: Option C. -> onetwo
Two strings can be concatenated by using concat() method.