Skip to content
Sharp

SQL for Java Devs · interview question

When extracting a 'price' column from a ResultSet, which method should be used to ensure the value is retrieved as a double?

Multiple choiceMediumchapter-8-curatedpremiumsql-for-java-devsresultsets-and-mapping
Choose one answer
Answer and explanation

Correct answer

C. GetDouble("price")

Why

The getDouble("price") method is designed to retrieve the value of the specified column as a double, ensuring type safety.

Test yourself on SQL for Java Devs

A free test with instant, explained results. No account needed.

Start free test
All SQL for Java Devs questions →