What does static mean in Java?
A static member belongs to the class. An instance member belongs to a particular object.
Why use equals for Java strings?
equals compares string contents. The == operator checks whether both references point to the same object.
What is a Java record useful for?
A record is useful for carrying fixed components, such as a product ID and name. Java generates accessors and common methods for those components.
What is a DTO in a Java API?
A data transfer object defines the fields an API receives or sends. It can keep internal entity fields out of the public response.
What is a path variable in a Spring controller?
It reads part of the URL path. In /products/42, the value 42 can identify the product to retrieve.
When should a REST API return HTTP 201?
Use 201 Created when a request successfully creates a resource. A Location header can tell the client where to retrieve it.
What is the difference between a unit test and an integration test in Java?
A unit test exercises a small piece of behavior in isolation. An integration test checks whether components such as a controller and database layer work together.
What is an entity in JPA?
An entity is a Java object type mapped to stored data. Its identifier distinguishes one persisted record from another.
What does a database transaction protect in a Java application?
It groups related operations so they can succeed or roll back together. Updating stock and recording a sale can be part of one transaction.
Why paginate a Spring Boot API response?
Returning a limited set of rows controls response size. Use a stable sort so records appear in a predictable order across pages.
See the beginner Q&A guide for related topics.