Skip to content
Sharp

SQL for Java Devs · interview question

In a JDBC-based e-commerce application using the Repository pattern, what is the primary purpose of a Repository class?

Multiple choiceEasychapter-8-curatedpremiumsql-for-java-devsrepository-pattern
Choose one answer
Answer and explanation

Correct answer

A. To act as an interface for CRUD operations on a data source

Why

The Repository class in the Repository pattern encapsulates the logic for accessing data from a data source, such as a database. It provides a clean API for performing CRUD operations without exposing the details of the data source.

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 →