0–5 min
Real Hook
5–20 min
Core Concept
20–40 min
Live Coding
40–55 min
You Code It
55–60 min
Cheat Sheet
🔥 Real-World Hook (0–5 min)

GitHub Copilot made developers 55% faster in Microsoft's study. Developers who use AI write better tests, catch more bugs, and deliver features faster.

But the developers who get replaced aren't those who use AI — they're those who don't. Today you learn to use LLMs as a pair programmer that never sleeps and knows every framework.

🤖 LLM as Your Coding Partner (5–20 min)

💡 Mental Model

Think of an LLM as a very senior developer who:
✔ Has read every Stack Overflow answer ever written
✔ Knows Java, Spring, SQL, React, Docker, Git
✔ Never judges your questions
✔ But can be wrong — always verify critical code

Your job: ask precise questions. Get precise answers.

💻 Live Coding — Build a Feature with AI (20–40 min)

-- Prompt technique 1: Precise context
"I have a Spring Boot app with a Student entity (id, name, email, dept, gpa).
Write a JPA repository method that finds all students in a given department
with GPA above a threshold, sorted by GPA descending."

-- Prompt technique 2: Explain existing code
"Explain this Spring Boot code line by line:
[paste your code]"

-- Prompt technique 3: Debug with AI
"I'm getting this error: [paste error]
Here's my code: [paste code]
What's wrong and how do I fix it?"

-- Prompt technique 4: Generate tests
"Write JUnit 5 tests for this Spring Boot service method:
[paste method]
Include edge cases: null input, empty list, duplicate email."

🔭 Build an AI-Powered Chat Feature

// Spring Boot endpoint calling Groq API (free LLM)
@Service
public class AiService {
    @Value("${groq.api.key}")
    private String apiKey;

    private final RestTemplate rest = new RestTemplate();

    public String ask(String question) {
        var headers = new HttpHeaders();
        headers.setBearerAuth(apiKey);
        headers.setContentType(MediaType.APPLICATION_JSON);

        var body = Map.of(
            "model", "llama3-8b-8192",
            "messages", List.of(Map.of("role", "user", "content", question))
        );

        var resp = rest.postForObject(
            "https://api.groq.com/openai/v1/chat/completions",
            new HttpEntity<>(body, headers),
            Map.class
        );
        return ((Map) ((List) resp.get("choices")).get(0))
            .get("message").toString();
    }
}
🎯 You Code It (40–55 min)
  1. Sign up at console.groq.com — get a free API key (faster than OpenAI)
  2. Add the AiService class to your capstone project
  3. Create an endpoint POST /api/ask that accepts a question and returns an AI answer
  4. Add a chat box to your frontend HTML — input + submit button + answer area
  5. Connect it to your /api/ask endpoint using fetch
  6. Test: Ask "What are the top 3 Java interview questions?" — AI answers in your app!

📄 Day 14 Cheat Sheet — LLM for Dev

Best Prompt Patterns

Give context first"I have a Spring Boot app..."
Be specific"Write JPA method for..."
Include constraints"...sorted by GPA desc"
Paste the error"I get this error: ..."
Ask for tests"Write JUnit tests for..."
Ask for explanation"Explain line by line"

Free LLM APIs

Groq APIFastest, free tier, Llama3
Claude APIBest for code, Anthropic
Gemini APIGoogle, free tier
Ollama (local)Run on your laptop
GitHub CopilotIDE integration, student free

AI Tools for Java Dev

GitHub CopilotCode autocomplete in IDE
Claude.aiArchitecture & debugging
ChatGPTGeneral questions
Cursor IDEAI-first code editor
TabNineML autocomplete

When NOT to Trust AI

Security-critical codeReview manually
Database migrationsTest in dev first
Payment logicWrite yourself + test
Cutting-edge APIsAI may be outdated
Business logicYou know the domain