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
What exception is thrown when a database connection fails in JDBC?
In JDBC, what does the executeQuery() method return?
Which interface in JDBC is used to execute parameterized queries and prevent SQL injection attacks?
What is the correct sequence to establish a JDBC connection in Java?
Which method of Connection interface is used to start a transaction in JDBC?
In JDBC, what does the BatchUpdate feature allow developers to do?
Which exception is thrown when a JDBC driver is not found in the classpath?
What is the difference between commit() and rollback() in JDBC transactions?
In a JDBC application, which interface is responsible for executing SQL queries and returning ResultSet objects?