-
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);
}
}
-
- Mania
- Interview
- Interview Mania
- Compilation Error
- Runtime Error
Correct Option: C
append() method of class StringBuffer is used to concatenate the string representation to the end of invoking string.