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

In Java 8+, when using try-with-resources with multiple AutoCloseable resources, in what order are they closed?

Q.242Medium

Which of the following exceptions would NOT be caught by catching Exception class in Java?

Q.243Medium

Consider a scenario where you have nested try-catch blocks. If both inner and outer catch blocks match the thrown exception type, which one executes?

Q.244Medium

What does the getSuppressed() method of Throwable class return in context of try-with-resources?

Q.245Medium

In Java, when an exception is thrown in a try block and caught in a catch block, if the catch block also throws an exception, what happens to the original exception?

Q.246Medium

What is the default buffer size of BufferedReader in Java?

Q.247Medium

What happens when you try to read from a closed stream in Java?

Q.248Medium

Which of the following is a filtered stream?

Q.249Medium

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

Q.250Medium

Which of the following creates a bridge between character and byte streams?

Q.251Medium

What is the difference between FileInputStream and BufferedInputStream?

Q.252Medium

Which class allows reading and writing objects to a stream?

Q.253Medium

What is the mark() method used for in BufferedReader?

Q.254Medium

Which of the following statements will correctly read a file line by line?

Q.255Medium

What is the purpose of the skip() method in InputStream?

Q.256Medium

A Java program needs to read a file containing 10 million integers. Which approach would be most memory-efficient?

Q.257Medium

A serialized object contains a field marked as 'transient'. What happens to this field when the object is deserialized?

Q.258Medium

Which statement about ObjectOutputStream.reset() is correct?

Q.259Medium

When implementing Externalizable interface, which method is mandatory?

Q.260Medium

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