These Java Full Stack questions use examples you can try in a beginner project. Start with the terms you encounter in your own work.
What is a class in Java?
A class defines a type and its behavior. An InventoryItem class could define fields for a name and quantity and a method for adjusting stock.
What is a Java interface?
An interface defines a contract that classes can implement. A service can depend on an interface and use a real database or a test implementation.
What is the difference between ArrayList and HashMap?
An ArrayList stores values in sequence and accesses them by index. A HashMap looks up values by key, such as a product ID.
What is a checked exception in Java?
Java requires code to catch a checked exception or declare that it can throw it. An IOException is a common example.
What is dependency injection in Spring?
Spring can supply a class with the objects it depends on. A controller can receive a service through its constructor, which also makes the controller easier to test.
What is a REST controller in Spring Boot?
A REST controller maps HTTP requests to Java methods. Those methods can return data that Spring serializes as JSON.
What is a repository in a Spring application?
A repository handles access to stored records. A product repository might fetch a record by ID or look up items below a stock threshold.
What should a Java API return when a record does not exist?
Return HTTP 404 for a missing resource. A short response body can explain what was requested so the frontend can show a useful message.
For more course topics, see the ScholarLogic beginner Q&A guide.