Home » JAVA Programming » Files and I/O » Question
  1. What is the output of this program?
    public class output
    {
    public static void main(String args[])
    {
    StringBuffer c = new StringBuffer("InterviewMania");
    System.out.println(c.length());
    }
    }
    1. 11
    2. 12
    3. 13
    4. 14
    5. 15
Correct Option: D

length() method is used to obtain length of StringBuffer object, length of “InterviewMania” is 14.



Your comments will be displayed only after manual approval.