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

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

Q.42Medium

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

Q.43Easy

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

Q.44Medium

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

Q.45Medium

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

Q.46Medium

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

Q.47Medium

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

Q.48Hard

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

Q.49Easy

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

Q.50Hard

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

Q.51Hard

Which serialization approach maintains backward compatibility better?

Q.52Medium

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

Q.53Medium

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

Q.54Medium

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

Q.55Medium

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

Q.56Hard

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

Q.57Easy

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

Q.58Easy

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

Q.59Easy

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

Q.60Easy

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