π¬ Common questions from bootcamp participants. Can't find your question? Ask in #java-bootcamp!
- Type conversion errors
- When to use int vs long?
- Why do I see 027 = 23?
- Final vs Immutability
- Can I modify a final List?
- How much is "enough" for the certificate?
- Should I use Spring Boot for a basic project?
- How to structure my participant folder?
Follow these steps:
- Complete your project in
/participants/<your-name>/project/ - Write a clear README.md with setup instructions
- Create a pull request following HOW_TO_SUBMIT.md
- Wait for mentor review
Related: How to Submit Guide
Yes! Learning is the goal, not the specific project. Just:
- Update your project README
- Keep your existing work (don't delete learning history)
- Mention the pivot in your final submission
Tip: Sometimes "failing forward" with a project teaches more than succeeding with an easy one.
No problem:
- Check Session Notes for summaries
- Review any guides created from that session
- Ask questions in #java-bootcamp
- Sessions build on each other, but aren't mandatory
Key Resources:
Error: incompatible types: possible lossy conversion from double to int
Why this happens:
double price = 19.99;
int dollars = price; // β Compile errorJava won't automatically convert double β int because you'd lose the decimal part (19.99 becomes 19).
Solutions:
// Option 1: Keep as double
double dollars = price; // β
No data loss
// Option 2: Explicitly cast (you're accepting data loss)
int dollars = (int) price; // β
dollars = 19
// Option 3: Round instead of truncate
int dollars = (int) Math.round(price); // β
dollars = 20Going the other way is fine:
int count = 42;
double value = count; // β
Automatic widening conversionRelated Guide: Numeric Literals
Quick answer: Use int for 99% of cases. Only use long when you know you need it.
Use int when:
- Counting things (users, items, loops)
- IDs in small systems
- Whole numbers under ~2 billion
Use long when:
- Timestamps (
System.currentTimeMillis()) - File sizes
- Database IDs in large systems
- Money in cents (for precision)
Example:
// β
Good uses of int
int studentCount = 150;
int retryAttempts = 3;
// β
Good uses of long
long timestamp = System.currentTimeMillis(); // Would overflow int
long fileSize = 5_368_709_120L; // 5GB in bytesRelated Guide: Numeric Literals - Skip Section
This confused multiple people in Session 2!
The problem:
int value = 027;
System.out.println(value); // Prints: 23 (not 27!)Why: A leading zero (0) tells Java it's octal (base-8), not decimal (base-10).
27 in octal = 2Γ8ΒΉ + 7Γ8β° = 16 + 7 = 23 in decimal
The fix: Never use leading zeros unless you specifically need octal (you don't).
int value = 27; // β
This is 27Related Guide: Numeric Literals - Warning Section
Common misconception: "final makes something immutable"
Reality: final only locks the reference, not the content.
final List<String> names = new ArrayList<>();
names.add("Adriana"); // β
Allowed - modifying content
names = new ArrayList<>(); // β Not allowed - changing referenceTrue immutability means the content can't change:
String name = "Adriana";
name.replace("A", "B"); // Creates NEW string, original unchangedTo get true immutability:
- Use Records (Java 16+)
- Use String, Integer, etc. (built-in immutables)
- Or manually: final class + final fields + no setters
Related Guide: Final vs Immutability Section
Yes! This trips up many beginners.
final List<String> participants = new ArrayList<>();
participants.add("Olena"); // β
Allowed
participants.clear(); // β
Allowed
participants = new ArrayList<>(); // β Not allowedThink of it like this:
final= "This variable always points to the same List object"- It does NOT mean "the List contents are frozen"
To actually freeze the contents:
List<String> participants = List.of("Olena", "Lulu", "Val");
participants.add("Someone"); // β UnsupportedOperationExceptionRelated Guide: Final on Variables
The bootcamp officially uses JDK 21, but JDK 25 works fine too.
Why JDK 21?
- Long-Term Support (LTS) release
- Stable and widely adopted
- All modern features we teach (Records, Sealed Classes, Pattern Matching)
Can I use JDK 25?
Yes, it's backward compatible. Just make sure your build.gradle.kts specifies:
java {
sourceCompatibility = JavaVersion.VERSION_21
}Check your version:
java -versionDownload JDK 21:
Both work! Choose based on your preference:
IntelliJ IDEA (Community Edition):
- β Best Java tooling out-of-the-box
- β Excellent refactoring and code completion
- β Built-in Gradle support
- β Heavier on resources
VS Code:
- β Lightweight and fast
- β Great if you already use it for other languages
β οΈ Requires Extension Pack for Javaβ οΈ Less powerful refactoring
Mentor recommendation: IntelliJ for this bootcamp (better learning experience).
VS Code setup: Install Extension Pack for Java
Common issues:
# Mac/Linux
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
# Windows
# Set in System Environment Variables# Clean and rebuild
./gradlew clean build# Make it executable
chmod +x gradlew- Check your Java version:
java -version - Share the full error in #java-bootcamp
- Include your OS and IDE
Minimum viable submission:
- β Working Java project (even if small)
- β Demonstrates learning (code quality > complexity)
- β README with setup instructions
- β Basic tests (at least one)
Not required:
- β Complex features
- β Perfect code
- β Production-ready quality
The goal is learning, not perfection.
Examples of "enough":
- A working CLI tool with file I/O
- A simple REST API with 2-3 endpoints
- A basic application using core Java concepts
Related: Project Ideas
Short answer: No, unless you're specifically learning Spring Boot.
Beginner path:
- Start with core Java (no frameworks)
- Build a command-line app
- Get comfortable with OOP, collections, file I/O
- Then move to Spring Boot for your next project
Why avoid Spring Boot initially?
- Adds complexity that hides Java fundamentals
- Harder to debug when you don't know core Java
- Basic projects don't need a web framework
When to use Spring Boot:
- Intermediate projects (REST APIs, web apps)
- After you're comfortable with core Java
- When you specifically want to learn it
Related: Project Ideas - Basic vs Intermediate
Recommended structure:
participants/<your-name>/
βββ project/
β βββ src/
β β βββ main/java/...
β β βββ test/java/...
β βββ build.gradle.kts (if using Gradle)
β βββ README.md
β βββ ...
βββ notes/ (optional)
βββ session-notes.md
Your README should include:
- Project name and description
- How to run it
- Features implemented
- Technologies used
- What you learned
See example:
Related Guide: How to Submit
Ask in the community:
- Post in #java-bootcamp Slack channel
- Mention it in the next session
- Open a GitHub discussion
We'll add it to this FAQ!
This FAQ is community-maintained. Found a mistake? Submit a PR!
Last updated: 2026-02-19