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

What exception is thrown when a database connection fails in JDBC?

Q.22Easy

In JDBC, what does the executeQuery() method return?

Q.23Easy

Which interface in JDBC is used to execute parameterized queries and prevent SQL injection attacks?

Q.24Easy

What is the correct sequence to establish a JDBC connection in Java?

Q.25Easy

Which method of Connection interface is used to start a transaction in JDBC?

Q.26Easy

In JDBC, what does the BatchUpdate feature allow developers to do?

Q.27Easy

Which exception is thrown when a JDBC driver is not found in the classpath?

Q.28Easy

What is the difference between commit() and rollback() in JDBC transactions?

Q.29Easy

In a JDBC application, which interface is responsible for executing SQL queries and returning ResultSet objects?