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.1Medium

What is the default buffer size of BufferedReader in Java?

Q.2Medium

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

Q.3Medium

Which of the following is a filtered stream?

Q.4Medium

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

Q.5Medium

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

Q.6Medium

What is the difference between FileInputStream and BufferedInputStream?

Q.7Medium

Which class allows reading and writing objects to a stream?

Q.8Medium

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

Q.9Medium

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

Q.10Medium

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

Q.11Medium

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

Q.12Medium

A serialized object contains a field marked as 'transient'. What happens to this field when the object is deserialized?

Q.13Medium

Which statement about ObjectOutputStream.reset() is correct?

Q.14Medium

When implementing Externalizable interface, which method is mandatory?

Q.15Medium

In a CSV file processing application, why is BufferedReader preferred over FileReader for reading large files?

Q.16Medium

What is the serialVersionUID used for in Java serialization?

Q.17Medium

What happens when you write to a closed PrintWriter?

Q.18Medium

Which scenario would require using a SequenceInputStream?

Q.19Medium

A file contains 1000 lines. Using BufferedReader.readLine() repeatedly reads all lines. What is the time complexity?

Q.20Medium

What exception is thrown when trying to deserialize an object that was serialized with a different serialVersionUID?