iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

951 questions | 100% Free

Q.41Easy

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

Q.42Medium

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

Q.43Medium

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

Q.44Medium

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

Q.45Medium

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

Q.46Hard

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

Q.47Easy

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

Q.48Hard

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

Q.49Hard

Which serialization approach maintains backward compatibility better?

Q.50Medium

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

Q.51Medium

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

Q.52Medium

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

Q.53Medium

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

Q.54Hard

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

Q.55Easy

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

Q.56Easy

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

Q.57Easy

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

Q.58Easy

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

Q.59Easy

Which class provides buffering capability to improve I/O performance?

Q.60Medium

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