Files and I/O
- Which exception is thrown by read() method?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
read method throws IOException.
- 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());
}
}
-
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.