Home » JAVA Programming » Files and I/O » Question
  1. What is the output of this program?
    public class Result
    {
    public static void main(String args[])
    {
    StringBuffer strbuf = new StringBuffer("Interview Mania");
    StringBuffer strbuf0 = strbuf.reverse();
    System.out.println(strbuf0);
    }
    }
    1. Interview Mania
    2. ainaM weivretnI
    3. weivretnI
    4. ainaM
    5. None of these
Correct Option: B

reverse() method reverses all characters. It returns the reversed object on which it was called.



Your comments will be displayed only after manual approval.