1. Which class is used to read data from the keyboard in Java? A. Scanner B. FileReader C. BufferedReader D. InputStream Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. What is the purpose of the `System.out.println()` method in Java? A. It performs mathematical operations B. It writes data to a file C. It reads data from the keyboard D. It prints data to the standard output stream followed by a newline Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
3. Which method is used to write data to a file in Java? A. read() B. print() C. write() D. scan() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
4. How can you close a file after reading or writing in Java? A. By using the `terminate()` method B. By using the `close()` method of the file stream C. By using the `readLine()` method D. By using the `exit()` method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
5. What is the purpose of the `FileInputStream` class in Java? A. It is used to perform mathematical operations B. It is used to write data to a file C. It is used to read data from a file D. It is used to read data from the keyboard Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
6. Which class is used to read data from a file in Java? A. Scanner B. BufferedWriter C. OutputStream D. FileReader Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. What is the purpose of the `BufferedReader` class in Java? A. It is used to read data from a file efficiently B. It is used to read data from the keyboard C. It is used to write data to a file D. It is used to perform mathematical operations Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
8. Which method is used to read a line of text from the keyboard in Java? A. `nextLine()` B. `printLine()` C. `writeLine()` D. `readLine()` Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. In Java, what does the `FileOutputStream` class do? A. It is used to read data from a file B. It is used to read data from the keyboard C. It is used to write data to a file D. It is used to create directories Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
10. What is the purpose of the `PrintWriter` class in Java? A. It is used to read binary data from a file B. It is used to write formatted text to a file C. It is used to read text from the keyboard D. It is used to read & write binary data from a file Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board