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

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

Q.262Medium

What is the serialVersionUID used for in Java serialization?

Q.263Medium

What happens when you write to a closed PrintWriter?

Q.264Medium

Which scenario would require using a SequenceInputStream?

Q.265Medium

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

Q.266Medium

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

Q.267Medium

In a real-time application processing sensor data streams, which buffering approach would minimize latency?

Q.268Medium

When processing a large XML file, which approach is most memory-efficient?

Q.269Medium

What is the default charset used by InputStreamReader if none is specified?

Q.270Medium

In a multi-threaded application, which stream class is thread-safe?

Q.271Medium

Which method of PushbackInputStream allows you to return bytes to the stream to be read again?

Q.272Medium

For processing delimited text files with variable field counts, which class is most suitable?

Q.273Medium

What is the primary purpose of transient keyword in Java serialization?

Q.274Medium

In a file compression utility, which stream would you use for reading compressed data?

Q.275Medium

When combining multiple input sources into one logical stream, which class should be used?

Q.276Medium

What is the purpose of the mark() and reset() methods in buffered streams?

Q.277Medium

Consider a scenario where you need to read a line from a file. Which class would be most efficient?

Q.278Medium

What exception is thrown when attempting to deserialize an object with a different serialVersionUID?

Q.279Medium

In a multi-threaded application, what is a concern when sharing streams between threads?

Q.280Medium

What is the difference between InputStreamReader and FileReader?