Java and Spring Basics
Java Basics
Java is an object-oriented programming language. Key concepts include classes, objects,
inheritance, polymorphism, encapsulation, and abstraction. Java programs run on the JVM
(Java Virtual Machine), which enables platform independence.
Common collections include ArrayList, LinkedList, HashSet, HashMap, and TreeMap. Strings
are immutable, while StringBuilder is mutable and useful for efficient string manipulation.
Spring Framework Basics
Spring is a popular Java framework that simplifies enterprise application development. Its
core feature is Inversion of Control (IoC), implemented through Dependency Injection (DI).
Beans are objects managed by the Spring container. Annotations such as @Component,
@Service, @Repository, and @Controller help Spring discover and manage beans.
Spring Boot builds on Spring and reduces configuration effort. Common annotations include
@SpringBootApplication, @RestController, @GetMapping, @PostMapping, and
@Autowired.
Typical Spring Boot Flow
Client → Controller → Service → Repository → Database. Controllers handle requests,
services contain business logic, and repositories interact with databases.