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.681Hard

A developer wants to retrieve data from a stored procedure that returns multiple result sets and output parameters. Which approach is correct?

Q.682Easy

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

Q.683Medium

In JDBC 2024-25, which data type mapping is incorrect for Java to SQL?

Q.684Medium

What is the correct way to handle resource management in JDBC with Java 7+?

Q.685Hard

A query execution takes 5 seconds consistently. Which JDBC optimization technique should NOT be used for this scenario?

Q.686Medium

Which JDBC feature allows monitoring of database metadata like table structure and column information?

Q.687Hard

In a JDBC application using batch updates, what happens if one statement in the batch fails?

Q.688Easy

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

Q.689Medium

A developer needs to execute the same SQL query multiple times with different parameters. Which JDBC feature should be used to optimize performance?

Q.690Medium

When using ResultSet in JDBC, which cursor type allows bidirectional movement through rows but does not reflect database changes?

Q.691Medium

In JDBC 2024-25, which exception is thrown when attempting to use a closed Connection object?

Q.692Hard

A Java application requires connection pooling to handle 1000+ concurrent database requests efficiently. Which JDBC component should be implemented?

Q.693Hard

In JDBC metadata operations, which method is used to retrieve information about table structure, column names, and their data types?

Q.694Easy

What is the primary purpose of Generics in Java?

Q.695Easy

Which keyword is used to declare a generic class in Java?

Q.696Easy

What will be the output of the following code? List<String> list = new ArrayList<>(); list.add("Java"); System.out.println(list.get(0).length());

Q.697Easy

Which of the following is a valid generic method declaration?

Q.698Medium

What is type erasure in Java Generics?

Q.699Medium

Which statement about wildcard generics (?) is correct?

Q.700Medium

What will happen when you try to create an array of generics? List<String>[] array = new List<String>[10];