G Giao Linh New member Sep 19, 2021 #1 What will be the output of the following Java program? Code: class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); StringBuffer s2 = s1.reverse(); System.out.println(s2); } } A. Hello B. olleH C. HelloolleH D. olleHHello
What will be the output of the following Java program? Code: class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); StringBuffer s2 = s1.reverse(); System.out.println(s2); } } A. Hello B. olleH C. HelloolleH D. olleHHello
Nguyễn Nguyệt Ánh New member Sep 19, 2021 #2 Answer: b Explanation: reverse() method reverses all characters. It returns the reversed object on which it was called. Output: Code: $ javac output.java $ java output olleH Upvote 0 Downvote
Answer: b Explanation: reverse() method reverses all characters. It returns the reversed object on which it was called. Output: Code: $ javac output.java $ java output olleH