Vidyalelo
Java Programming · all questions

Input Output
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

77

Questions

2/4

Page

Pick an option on a question to see the right answer and solution.

In Java, how can you check if a file or directory exists using the `File` class?

Select an option to see the answer and solution.

Which method is used to delete a file or directory in Java?

Select an option to see the answer and solution.

In Java, what is the purpose of the `File.separator` constant?

Select an option to see the answer and solution.

What is the difference between character streams and byte streams in Java?

Select an option to see the answer and solution.

In Java, what is the purpose of the `BufferedWriter` class?

Select an option to see the answer and solution.

Which class is used for reading character streams in a platform-independent way in Java?

Select an option to see the answer and solution.

In Java, what is the primary purpose of the `PrintStream` class?

Select an option to see the answer and solution.

What is the difference between reading and writing character streams in Java?

Select an option to see the answer and solution.

In Java, which class is used to read binary data from an input stream?

Select an option to see the answer and solution.

What is the purpose of the `Console` class in Java?

Select an option to see the answer and solution.

System class is defined in .................

Select an option to see the answer and solution.

try{
      File f = new File("a.txt");
}catch(Exception e){
}catch(IOException io){
}

Is this code create new file name a.txt ?

Select an option to see the answer and solution.

Which of these classes defined in java.io and used for file-handling are abstract?
A. InputStream
B. PrintStream
C. Reader
D. FileInputStream
E. FileWriter

Select an option to see the answer and solution.

When comparing java.io.BufferedWriter and java.io.FileWriter, which capability exist as a method in only one of two ?

Select an option to see the answer and solution.

What does AWT stands for?

Select an option to see the answer and solution.

Which of these is used to perform all input & output operations in Java?

Select an option to see the answer and solution.

Which of these is a type of stream in Java?

Select an option to see the answer and solution.

Which of these classes are used by Byte streams for input and output operation?

Select an option to see the answer and solution.

Which of these classes are used by character streams for input and output operations?

Select an option to see the answer and solution.

Which of these class is used to read from byte array?

Select an option to see the answer and solution.