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

append() method of class StringBuffer is used to concatenate the string representation to the end of invoking string.



Your comments will be displayed only after manual approval.