Roadmaps › Languages
Java Developer Roadmap
From Java basics to backend development with Spring Boot.
Level: Beginner → Intermediate · Duration: 4–6 months
Step 1: Java Basics
Syntax, types and control flow — the foundation for everything else.
Java is a strongly typed, object-oriented language that runs on the JVM, so the same code works on any machine. It powers huge backend systems, Android apps and most enterprise software in India. Start with the syntax and control flow until writing small programs feels easy.
- Installing the JDK and running your first program
- Variables, data types and operators
- Conditionals and loops
- Methods, arrays and strings
Resources: ▶ Java Tutorial for Beginners · Java documentation · Java cheat sheet
JDK, JRE & JVM
How Java code is compiled to bytecode and run by the JVM.
javac compiles your .java files into bytecode; the JVM runs that bytecode on any operating system. The JDK contains the tools to develop, the JRE the parts needed to run.
- Difference between JDK, JRE and JVM
- Compiling with javac and running with java
- What bytecode is and "write once, run anywhere"
- The main method signature
Data types & operators
Primitives vs references, casting, integer overflow.
Java has eight primitive types plus reference types like String and arrays. Knowing their sizes and limits avoids overflow bugs, and understanding references avoids confusing equality bugs.
- byte, short, int, long, float, double, char, boolean
- Integer overflow and when to use long
- Type casting (implicit and explicit)
- Arithmetic, relational, logical and bitwise operators
- == vs .equals()
Conditionals & loops
if/else, switch, for, while, enhanced for.
Control flow decides which code runs and how many times. Java's syntax is shared with C, C++ and JavaScript, so these skills transfer.
- if / else if / else and the ternary operator
- switch (including the newer arrow syntax)
- for, while, do-while and enhanced for
- break and continue
Methods & arrays
Parameters, return values, 1D/2D arrays.
Methods split code into reusable pieces; arrays hold fixed-size collections of values. Java always passes arguments by value — but for objects, that value is a reference.
- Defining methods with parameters and return types
- Method overloading
- 1D and 2D arrays, Arrays.sort and Arrays.toString
- Pass-by-value and what it means for arrays
Strings
String vs StringBuilder, immutability, common methods.
Strings are immutable in Java: every change creates a new object. Use StringBuilder when building strings in a loop.
- Common String methods: length, charAt, substring, indexOf, split
- String immutability and the string pool
- StringBuilder for efficient concatenation
- Comparing strings correctly
Step 2: OOP
Model real things with classes and objects.
Everything in Java lives inside a class, so object-oriented programming is not optional. Learn to model real things as classes with data and behaviour, and to use inheritance and interfaces to keep code flexible.
- Classes and objects
- The four pillars of OOP
- Abstract classes and interfaces
- Designing small class hierarchies
Resources: Notes: Java OOP Concepts · Interview questions: OOP · ▶ Java + DSA + Interview Preparation
Classes, objects & constructors
this, static, access modifiers.
A class is a blueprint; objects are instances created with new. Constructors set up a new object, and access modifiers control what other code can see.
- Fields, methods and constructors
- this keyword and constructor overloading
- static members
- public, private, protected and default access
Resources: Notes: Classes, Objects, Constructors
Four pillars
Encapsulation, abstraction, inheritance, polymorphism.
Encapsulation hides data behind methods, abstraction exposes only what matters, inheritance reuses code, and polymorphism lets one interface have many behaviours.
- Encapsulation with private fields and getters/setters
- Inheritance with extends and super
- Method overriding and runtime polymorphism
- Abstraction through abstract classes and interfaces
Resources: Notes: Four Pillars of OOP
Abstract classes & interfaces
When to use which; default methods.
Abstract classes share code and state between related classes; interfaces define a contract any class can implement. A class can implement many interfaces but extend only one class.
- abstract methods and classes
- interfaces, default and static methods
- Multiple inheritance through interfaces
- Choosing between them
Resources: Notes: Abstract Class vs Interface
SOLID principles (optional)
Write classes that are easy to change.
SOLID is a set of five design guidelines that keep classes small, focused and easy to change.
- Single responsibility and open/closed
- Liskov substitution
- Interface segregation and dependency inversion
Resources: Notes: SOLID Principles
Step 3: Collections & Generics
Ready-made data structures you will use every day.
The Java Collections Framework gives you ready-made, well-tested data structures. Generics make them type-safe, so the compiler stops you from putting the wrong type in.
- The collection interfaces and their implementations
- Choosing the right collection for the job
- Generics and type safety
- Sorting and comparing objects
Resources: Notes: Java Collections Framework · ▶ Java & DSA Placement Course
List, Set, Map, Queue
ArrayList, HashSet, HashMap, ArrayDeque, PriorityQueue.
Each interface solves a different need: ordered lists, unique sets, key–value maps and queues. Knowing their performance helps in interviews and real code.
- ArrayList vs LinkedList
- HashSet, LinkedHashSet, TreeSet
- HashMap, LinkedHashMap, TreeMap
- ArrayDeque and PriorityQueue
- How HashMap works internally (buckets, hashCode, equals)
Generics
Type-safe containers and methods.
Generics let classes and methods work with any type while keeping type checking, e.g. List
- Generic classes and methods
- Bounded types (<T extends Number>)
- Wildcards (? extends, ? super)
- Type erasure in brief
Comparable & Comparator
Sorting objects your own way.
Comparable defines an object's natural order; Comparator defines any custom order. You need them to sort objects or use them in TreeMap and PriorityQueue.
- Implementing compareTo
- Writing Comparators with lambdas
- Comparator.comparing and thenComparing
- Sorting lists of objects
Streams & lambdas (optional)
map / filter / collect for concise data processing.
Lambdas are short anonymous functions; streams use them to filter, transform and collect data in a readable, declarative way.
- Lambda syntax and functional interfaces
- filter, map, sorted, collect
- Collectors.groupingBy and toMap
- Optional
Step 4: Exception Handling & File I/O
Handle errors cleanly and work with files.
Real programs must handle failures — missing files, bad input, network errors — without crashing. Java's exception system forces you to think about them.
- The exception hierarchy
- try / catch / finally
- Creating custom exceptions
- Reading and writing files
Checked vs unchecked
try / catch / finally, throws, custom exceptions.
Checked exceptions (like IOException) must be handled or declared; unchecked exceptions (like NullPointerException) signal programming bugs.
- Throwable, Exception, RuntimeException, Error
- throws vs throw
- When to create a custom exception
- Common runtime exceptions and their causes
try-with-resources
Close files and connections automatically.
try-with-resources closes files, streams and connections automatically, even when an exception happens — no more forgotten close() calls.
- The AutoCloseable interface
- Multiple resources in one try
- Suppressed exceptions
Reading & writing files
Files, BufferedReader, BufferedWriter.
Java can read and write text and binary files. The newer Files API makes common tasks one-liners.
- Files.readAllLines and Files.write
- BufferedReader and BufferedWriter
- Paths and handling missing files
Step 5: Multithreading
Run tasks in parallel safely.
Multithreading lets a program do several things at once — handle many requests, run background work. It is powerful but introduces race conditions, so learn the safety tools too.
- Threads and their lifecycle
- Race conditions and synchronization
- Thread pools
- Thread-safe collections
Threads & Runnable
Creating and starting threads.
Create a thread by extending Thread or, better, by passing a Runnable. Understand the thread lifecycle and how start() differs from run().
- Thread vs Runnable
- start(), run(), sleep() and join()
- Thread states
- Daemon threads
Synchronization
Race conditions, synchronized, locks.
When threads share data, updates can collide. synchronized blocks, locks and volatile make sure only one thread changes shared state at a time.
- Race conditions with a shared counter
- synchronized methods and blocks
- volatile and visibility
- Deadlocks and how to avoid them
Resources: Notes: Process vs Thread
ExecutorService
Thread pools and futures.
Creating threads by hand is costly. An ExecutorService reuses a pool of threads and returns Futures for results.
- Executors.newFixedThreadPool
- submit(), Future and Callable
- Shutting down a pool properly
- CompletableFuture basics
Concurrent collections (optional)
ConcurrentHashMap, atomic variables.
Java provides collections that are safe to use from many threads without manual locking.
- ConcurrentHashMap
- CopyOnWriteArrayList
- AtomicInteger and other atomic classes
Step 6: JDBC & SQL
Store and query data in a relational database.
Almost every Java backend stores data in a relational database. Learn SQL first, then how Java talks to the database with JDBC — the foundation under JPA and Spring Data.
- Writing SQL queries
- Connecting with JDBC
- Preventing SQL injection
- Transactions
Resources: SQL documentation · MySQL documentation · ▶ SQL Complete Course (MySQL)
SQL basics
SELECT, JOIN, GROUP BY, indexes.
SQL is the language for querying relational data. Practise until joins and grouping feel natural.
- CREATE, INSERT, UPDATE, DELETE
- SELECT with WHERE, ORDER BY, LIMIT
- JOINs and GROUP BY
- Primary and foreign keys
Resources: Notes: SQL Essentials and Joins
JDBC
Connections, PreparedStatement, ResultSet.
JDBC is Java's standard API for databases: open a connection, run statements and read results. Always use PreparedStatement for user input.
- DriverManager and Connection
- PreparedStatement and parameters
- Reading a ResultSet
- Connection pooling (HikariCP)
Transactions
Commit / rollback and ACID.
Turn off auto-commit to group several statements into one transaction, then commit or roll back together.
- setAutoCommit(false), commit and rollback
- ACID properties
- Isolation levels
Resources: Notes: Transactions and ACID
Step 7: Spring Boot
The most used Java framework for backend APIs.
Spring Boot is the most popular framework for Java backends. It wires your classes together, starts an embedded server and gives you production-ready features with very little setup.
- Creating a project with Spring Initializr
- Layered architecture: controller → service → repository
- Configuration with application.properties
- Building REST APIs backed by a database
Resources: ▶ Spring 6 & Spring Boot · Spring Boot guides · ▶ Spring Boot Mastery
Dependency injection
Beans, @Component, @Autowired.
Instead of creating objects with new everywhere, Spring creates them (beans) and injects them where needed. This makes code loosely coupled and easy to test.
- Beans, @Component, @Service, @Repository
- Constructor injection
- The application context
- Bean scopes
REST controllers
@RestController, request mapping, validation.
Controllers map HTTP requests to Java methods and return JSON automatically.
- @RestController, @GetMapping, @PostMapping
- @PathVariable, @RequestParam, @RequestBody
- ResponseEntity and status codes
- Validation with @Valid and global exception handling
Spring Data JPA
Entities, repositories, relationships.
JPA maps Java classes to database tables, and Spring Data generates common queries from method names — you rarely write SQL by hand.
- @Entity, @Id and relationships (@OneToMany)
- JpaRepository CRUD methods
- Derived query methods and @Query
- Pagination and sorting
Spring Security & JWT
Login, roles and protected APIs.
Spring Security protects your endpoints. With JWT, users log in once and send a token with every request.
- Security filter chain configuration
- Password encoding with BCrypt
- Issuing and validating JWTs
- Role-based access (@PreAuthorize)
Testing (optional)
JUnit 5 and Mockito.
JUnit 5 and Mockito test services in isolation; Spring Boot test slices test controllers and repositories.
- JUnit 5 assertions
- Mockito mocks
- @WebMvcTest and @DataJpaTest
Step 8: Build tools & Git (optional)
Manage dependencies and code history.
Build tools download libraries and package your app; Git tracks your code. Every Java team uses both.
- Maven or Gradle basics
- Git workflow with branches
- Packaging a runnable JAR
Resources: Git documentation · ▶ Complete Git and GitHub Tutorial
Maven or Gradle
pom.xml / build.gradle, dependencies, packaging a JAR.
Maven (pom.xml) and Gradle (build.gradle) manage dependencies and build steps. Spring Boot projects use one of them.
- Adding dependencies
- Build lifecycle: compile, test, package
- Running mvn spring-boot:run / gradle bootRun
Git & GitHub
Commits, branches, pull requests.
Commit your work in small steps and push it to GitHub — interviewers often look at your repositories.
- commit, branch, merge, push
- .gitignore for target/ and build/
- Pull requests
Resources: Git cheat sheet
Step 9: Build Projects
Make 2–3 full backend projects and deploy them.
Projects turn knowledge into proof. Build two or three complete Spring Boot backends, deploy at least one, and be ready to explain every design decision.
- Planning entities and endpoints
- Writing clean layered code
- Documenting the API (Swagger)
Resources: Interview questions: Java
CRUD REST API
e.g. a library or expense tracker with a database.
Start with a full CRUD API for something real — a library, expense tracker or job board — backed by a database.
- Entities, repositories, services and controllers
- Validation and error responses
- Pagination and search
Auth project
Users, login with JWT, roles.
Add users, login and roles: this is what most real backends need and what interviewers ask about.
- Registration and login with JWT
- Role-based endpoints (user vs admin)
- Password reset flow
Deploy (optional)
Package as a JAR / Docker image and deploy on Render or Railway.
A live link makes your project far more convincing. Package it as a JAR or Docker image and deploy it.
- Building a JAR / Docker image
- Deploying on Render or Railway
- Connecting a managed database
Resources: Docker documentation