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

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

Q.542Medium

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

Q.543Easy

Which class would you use to read and write at arbitrary positions in a file?

Q.544Medium

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

Q.545Medium

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

Q.546Medium

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

Q.547Medium

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

Q.548Hard

For encrypting data while writing to a file, which approach is most appropriate?

Q.549Easy

What happens when you attempt to read from a closed InputStream?

Q.550Hard

In Java NIO, what is a key advantage of FileChannel over traditional I/O streams?

Q.551Hard

Which serialization approach maintains backward compatibility better?

Q.552Medium

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

Q.553Medium

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

Q.554Medium

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

Q.555Medium

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

Q.556Hard

For developing a high-performance file copying utility handling files up to 10GB, which approach is optimal?

Q.557Easy

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

Q.558Easy

What is the output of the following code? FileReader fr = new FileReader("test.txt"); int data = fr.read(); System.out.println(data);

Q.559Easy

Which interface must be implemented by a class to make its objects serializable?

Q.560Easy

What does the flush() method do in output streams?

Java Programming MCQs – Free Practice Test | iGET | iGET