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.161Easy

Which stream class is used to write primitive data types in binary format?

Q.162Easy

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

Q.163Easy

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

Q.164Easy

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

Q.165Easy

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

Q.166Easy

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

Q.167Easy

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?

Q.168Easy

Which interface in JDBC is used to execute SQL queries and obtain results?

Q.169Easy

What is the correct order of JDBC operations?

Q.170Easy

Which JDBC driver type is platform-independent and does not require native code?

Q.171Easy

What exception is thrown when a database connection cannot be established?

Q.172Easy

Which method is used to retrieve a String value from a ResultSet object?

Q.173Easy

Which JDBC driver type is platform-independent and does not require native code installation?

Q.174Easy

What is the correct syntax to retrieve an integer value from a ResultSet object at column index 2?

Q.175Easy

Which interface represents a single row of data retrieved from a database in JDBC?

Q.176Easy

In JDBC, what is the purpose of the Class.forName() method?

Q.177Easy

What happens when you call rs.next() on a ResultSet after the last row?

Q.178Easy

Which interface in JDBC is used to execute a single SQL statement and return a ResultSet?

Q.179Easy

What is the primary advantage of using PreparedStatement over Statement in JDBC?

Q.180Easy

Which JDBC method is used to retrieve the number of rows affected by an INSERT, UPDATE, or DELETE statement?