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

1/4

Page

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

Which class is used to read data from the keyboard in Java?

Select an option to see the answer and solution.

What is the purpose of the `System.out.println()` method in Java?

Select an option to see the answer and solution.

Which method is used to write data to a file in Java?

Select an option to see the answer and solution.

How can you close a file after reading or writing in Java?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which class is used to read data from a file in Java?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which method is used to read a line of text from the keyboard in Java?

Select an option to see the answer and solution.

In Java, what does the `FileOutputStream` class do?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which class is used to write binary data to a file in Java?

Select an option to see the answer and solution.

In Java, which method is used to write binary data to a file?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which class is used to write formatted text to a file in Java?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

In Java, what does the `DataOutputStream` class do?

Select an option to see the answer and solution.

Which class is used to write primitive data types to an output stream in Java?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

In Java, which class is used to read and write character streams?

Select an option to see the answer and solution.

What is the primary purpose of the `File` class in Java?

Select an option to see the answer and solution.