Which of this method of class stringbuffer is used to reverse sequence of characters?
Java MCQs on StringBuffer class of Java Programming Language. Nội dung chính Show 1. Which of these class is used to create an object whose character sequence is mutable? Answer: b 2. Which of this method of class StringBuffer is used to concatenate the string representation to the end of invoking string? Answer: b 3. Which of these method of class StringBuffer is used
to find the length of current character sequence? Answer: a 4. What is the string contained in s after following lines of Java code? StringBuffer s new StringBuffer("Hello"); s.deleteCharAt(0); a)
Hell Answer: b 5. Which of the following statement is correct? Answer: a 6. What will be the output of the following Java program?
a) 6 4 6 9 Answer: d $ javac output.java $ java output 1 14 8 15 7. What will be the output of the following Java program?
a) He Answer: d $ javac output.java $ java output llo 8. What will be the output of the following Java program?
a) Hello Answer: d $ javac output.java $ java output Hello World 9. What will be the output of the following Java program?
a) Hello Answer: b $ javac output.java $ java output olleH 10. What will be the output of the following Java program? Answer: c Which of this method of class StringBuffer is used to reverse sequence of characters?In order to reverse the sequence of characters in a StringBuffer Object, we use the reverse() method. Which of this method of class StringBuffer is used to concentrate the String representation to the end of invoking String?Clarification: append() method of class StringBuffer is used to concatenate the string representation to the end of invoking string. Which method can be used to set the length of the buffer within a StringBuffer object?The setLength(int newLength) method is used to change the length of the StringBuffer Object. It sets the length of the character sequence. The character sequence is updated to a new one whose length is determined by the value passed as the parameter in the method. Which of this method of class String is used to obtain a length of String object?Which of this method of class String is used to obtain a length of String object? Explanation: Method length() of string class is used to get the length of the object which invoked method length(). Which of these method of class StringBuffer is used to reverse sequence of characters Options Reverse () Reverseall () reverse () Reverseall ()?reverse() is an inbuilt method that is used to reverse the characters in the StringBuffer.
Which of these method of class StringBuffer is used to concatenate?Explanation: append() method of class StringBuffer is used to concatenate the string representation to the end of invoking string.
Which of the following statement is correct reverse () method reverses all characters?Answer: dExplanation: append() method of class StringBuffer is used to concatenate the string representationto the end of invoking string.
Which of these method of class StringBuffer is used to extract a substring from a String object?The substring(int start) method of StringBuffer class is the inbuilt method used to return a substring start from index start and extends to end of this sequence.
|