iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.1Easy

Which of the following is a character stream class in Java?

Q.2Medium

What is the default buffer size of BufferedReader in Java?

Q.3Easy

Which method is used to read a single byte from a FileInputStream?

Q.4Medium

What happens when you try to read from a closed stream in Java?

Q.5Medium

Which of the following is a filtered stream?

Q.6Easy

What is the purpose of the flush() method in output streams?

Q.7Medium

Which class is used to read primitive data types from a stream?

Q.8Easy

What is the return type of FileInputStream's read() method?

Q.9Medium

Which of the following creates a bridge between character and byte streams?

Q.10Easy

What exception is thrown when a file is not found while creating FileInputStream?

Q.11Easy

Which method reads a complete line from a BufferedReader?

Q.12Medium

What is the difference between FileInputStream and BufferedInputStream?

Q.13Medium

Which class allows reading and writing objects to a stream?

Q.14Medium

What is the mark() method used for in BufferedReader?

Q.15Medium

Which of the following statements will correctly read a file line by line?

Q.16Medium

What is the purpose of the skip() method in InputStream?

Q.17Hard

In Java NIO, which class replaces traditional Stream-based I/O for better performance?

Q.18Hard

What happens if you call close() multiple times on a stream?

Q.19Hard

Which of the following is true about serialization in Java?

Q.20Medium

A Java program needs to read a file containing 10 million integers. Which approach would be most memory-efficient?