"You don't need years of Java to start. You need just enough to read the code in this track — and that's what this module gives you."
Level: Beginner · Time: ~2–3 days · Prerequisites: Module 1
Learning Objectives
By the end of this module, you will be able to:
- Understand what Java and the JVM are
- Read a simple Java class and method
- Explain what Spring Boot, beans, and dependency injection mean
- Recognize the annotations you'll see throughout this track
1. What Is Java?
Java is a programming language that's been powering serious software for ~30 years. You write code in .java files, a compiler turns it into bytecode, and the JVM (Java Virtual Machine) runs that bytecode on any operating system. That "write once, run anywhere" quality is why big organizations trust it — the same compiled program runs unchanged on Windows, macOS, or a Linux server in the cloud, so banks, insurers, and governments have relied on Java for decades.
Java is object-oriented: you organize code into classes (blueprints) that hold data (fields) and behavior (methods).
[object Object], ,[object Object], ,[object Object], {
,[object Object], String ,[object Object],[object Object], {
,[object Object], ,[object Object], + name + ,[object Object],;
}
}Explain like I'm new: A class is like a cookie cutter, and an object is a cookie made from it. greet is a method — an action the object can perform.
To actually use this class, another piece of code creates a Greeter object and calls greet("Ada"), which returns the string "Hello, Ada!". Almost everything in Java lives inside a class like this, so once you can read one class, you can read them all.
2. What Is Spring Boot?
Building a Java web app from scratch means wiring together dozens of pieces (a web server, configuration, logging…). Spring is a framework that provides those pieces; Spring Boot makes them work together with almost no setup — it's "Spring with the batteries included."
You describe what you want with annotations, and Spring Boot wires up the how. Before Spring Boot, starting a web project meant hundreds of lines of XML configuration and manual server setup; today you add a single dependency and get a running server on the first try.
Concept: Auto-configuration is Spring Boot's superpower. Add a dependency (like Spring AI's OpenAI starter), set a few properties, and Spring Boot automatically creates and connects the objects you need.
Try this: Skim any Spring Boot project's pom.xml. Each <dependency> you add — web, security, or AI — quietly switches on a matching set of auto-configured beans. That is auto-configuration silently doing your setup work.
3. Beans and Dependency Injection
A bean is simply an object that Spring creates and manages for you. Dependency injection (DI) means: instead of building the objects you need, you just ask for them, and Spring hands them over.
[object Object],
,[object Object], ,[object Object], ,[object Object], {
,[object Object], ,[object Object], ChatClient chatClient;
,[object Object],
,[object Object], ,[object Object],[object Object], {
,[object Object],.chatClient = builder.build();
}
}Explain like I'm new: DI is like a restaurant. You don't go into the kitchen to cook — you ask the waiter, and the meal arrives. You ask for a ChatClient; Spring's "kitchen" prepares and delivers it.
4. Annotations You'll See
Annotations start with @ and tell Spring how to treat a class or method:
| Annotation | Meaning |
|---|---|
@SpringBootApplication | Marks the app's starting point |
@RestController | This class handles web requests (returns data) |
@Service | This class holds business logic |
@Bean | This method produces a managed object |
@Configuration | This class defines beans/settings |
You'll see these repeatedly. You don't need to memorize them — just recognize that they're instructions to Spring.
5. Maven and Project Structure
Maven is Java's build tool. A file called pom.xml lists your project's dependencies (libraries to download) and lets you build and run the app with commands like mvn spring-boot:run.
A typical Spring Boot project looks like:
src/main/java → your code (.java files)
src/main/resources
application.yaml → configuration (keys, model names)
pom.xml → dependencies + build settingsCommon mistake: Thinking you must understand all of Java before building anything. You don't. Recognizing classes, methods, beans, and annotations is enough to follow — and build — everything in this track.
✅ Checkpoint
- What does the JVM do?
- In plain words, what is a "bean"?
- What file lists a Maven project's dependencies?
Answers: 1) It runs compiled Java bytecode on any operating system. 2) An object that Spring creates and manages for you. 3) pom.xml.
Key Takeaway: Java is an object-oriented language that runs on the JVM. Spring Boot removes the boilerplate through auto-configuration, giving you beans (managed objects) via dependency injection (you ask, Spring provides). Annotations like @RestController and @Service tell Spring what each class does, and Maven's pom.xml manages your libraries. That's all the Java you need to begin.
Further Learning
Part of "Spring AI for Beginners." Adapted from Microsoft's open Spring AI curriculum (MIT License).