Strings(Java Program ) Questions and Answers
Explanation:-
Answer: Option A. -> trueOutput will be True. Since when s1.charAt(0) ascii value is greater then s2.charAt(0). So it will return True.
Explanation:-
Answer: Option B. -> bcsubstring() method has two variants and returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string or upto endIndex - 1 if second argument is given.
Syntax: Here is the syntax of this method:
public String substring(int beginIndex)
or
public String substring(int beginIndex, int endIndex)
Parameters: Here is the detail of parameters:
beginIndex -- the begin index, inclusive.
endIndex -- the end index, exclus
Explanation:-
Answer: Option C. -> onetwoConcat() method appends one String to the end of another. The method returns a String with the value of the String passed into the method appended to the end of the String which is used to invoke this method.