Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (B) olleH

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
96
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ravi Shankar
Publisher
πŸ“ˆ
91%
Success Rate