Files and I/O


  1. Which exception is thrown by read() method?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    read method throws IOException.


  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. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

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