Java MCQ Questions - Java.io
This section focuses on the "Java.io" of Java programming. These Multiple Choice Questions (MCQ) should be practiced to improve the Java programming skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. Java I/O is used to process the?
View Answer
2. Can we perform file handling in Java by Java I/O API?
View Answer
3. In java, how many streams are created for us automatically?
View Answer
4. Which method is used to write a byte to the current output stream?
View Answer
5. Which method is used to write an array of byte to the current output stream?
View Answer
6. Which of these class is not a member class of java.io package?
View Answer
7. ObjectFilter is a member of java.io package.
View Answer
8. ___________ returns true if called on a file and returns false when called on a directory.
View Answer
9. What will be output for the following code?
import java.io.*;
class files
{
public static void main(String args[])
{
File obj = new File(""/java/system"");
System.out.print(obj.getName());
}
}
View Answer
10. What will be output for the following code? Note: file is made in c drive
import java.io.*;
class files
{
public static void main(String args[])
{
File obj = new File(""/java/system"");
System.out.print(obj.canWrite());
System.out.print("" "" + obj.canRead());
}
}
View Answer
Discussion