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

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

Q.22Medium

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

Q.23Medium

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

Q.24Medium

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

Q.25Medium

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

Q.26Medium

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

Q.27Medium

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

Q.28Medium

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

Q.29Medium

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

Q.30Medium

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

Q.31Medium

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

Q.32Medium

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

Q.33Medium

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

Q.34Medium

What is the difference between InputStreamReader and FileReader?

Q.35Medium

Consider processing a 1GB file. Which approach would be most memory-efficient?

Q.36Medium

What does the available() method in InputStream return?

Q.37Medium

In Java NIO, which class is used for channel-based I/O?

Q.38Medium

What is the correct way to ensure resources are properly closed in Java 7+?

Q.39Medium

What happens when you create a FileOutputStream with an existing file?

Q.40Medium

What is the default buffer size used by BufferedInputStream?