iGET

Java Programming - MCQ Practice Questions

Java interviews and campus tests lean heavily on object oriented behaviour rather than API recall. This set covers inheritance and polymorphism, interfaces and abstract classes, the collections framework, exception handling, multithreading, string handling, and JVM basics such as garbage collection. Output based questions are included because they expose the gaps that theory questions hide.

951 questions | 100% Free

Q.21Easy

Which of the following is NOT a character stream class in Java?

Q.22Easy

Which interface must be implemented to make an object serializable in Java?

Q.23Easy

In Java, what is the primary purpose of the flush() method in output streams?

Q.24Easy

What will be the output of the following code?
FileOutputStream fos = new FileOutputStream("test.txt", true);
What does the 'true' parameter indicate?

Q.25Easy

Which of the following classes is used to read primitive data types from an input stream in Java?

Q.26Easy

Which interface must a class implement to be eligible for serialization in Java, and what is the significance of implementing it with no abstract methods?