Accompanying code repository: github.com/rajit2004/java_progress – over 173 solved problems, categorized by topic.
- Follow the phases in order — each builds on the last.
- Don't rush. Understanding > speed.
- Code every single day, even if only for 20 minutes.
- When stuck, Google it, read docs, ask on Stack Overflow — that is programming.
- Use the code in my java_progress repo to see working examples.
| Phase | Topic | Estimated Time |
|---|---|---|
| 0 | Setup & First Program | 1–2 days |
| 1 | Core Java Basics | 3–4 weeks |
| 2 | Object-Oriented Programming | 3–4 weeks |
| 3 | Intermediate Java | 3–4 weeks |
| 4 | Data Structures & Algorithms | 6–8 weeks |
| 5 | Real Projects | Ongoing |
| 6 | Ecosystem & Career | 4–6 weeks |
Total time to job-ready: ~6 to 9 months with consistent daily practice.
- JDK (Java Development Kit) — Download from adoptium.net (choose Java 21 LTS).
- IDE (Integrated Development Environment)
- Recommended: IntelliJ IDEA Community Edition (free, industry standard)
- Alternative: VS Code with the Java Extension Pack
Open a terminal and type:
java --version
javac --versionBoth should print a version number. If they do — you're ready.
Create a file called HelloWorld.java and type this out (don't copy-paste yet!):
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}Run it. See Hello, World! appear. You are now a programmer. 🎉
- Every Java program lives inside a class
- Execution starts at the
mainmethod System.out.println()prints to the console- Java files end in
.java; compiled files end in.class
💡 Check my repo: See
src/Basics/HelloWorld.javafor this exact program.
This is your foundation. Master every topic here before moving on.
int age = 25;
double price = 9.99;
boolean isStudent = true;
char grade = 'A';
String name = "Alice";Topics:
- Primitive types:
int,double,float,long,short,byte,char,boolean - Reference types:
String, arrays, objects - Variable naming rules and conventions (camelCase)
finalkeyword (constants)- Type casting (converting between types)
- Arithmetic:
+,-,*,/,% - Comparison:
==,!=,<,>,<=,>= - Logical:
&&,||,! - Assignment:
=,+=,-=,*= - Increment/Decrement:
++,--
// If-else
if (age >= 18) {
System.out.println("Adult");
} else {
System.out.println("Minor");
}
// Switch
switch (grade) {
case 'A': System.out.println("Excellent"); break;
case 'B': System.out.println("Good"); break;
default: System.out.println("Keep trying");
}// For loop
for (int i = 0; i < 5; i++) {
System.out.println(i);
}
// While loop
int count = 0;
while (count < 5) {
count++;
}
// For-each (used with arrays/collections)
int[] numbers = {1, 2, 3, 4, 5};
for (int n : numbers) {
System.out.println(n);
}Also learn: break, continue, nested loops
int[] scores = new int[5]; // declare
int[] marks = {90, 85, 78, 92}; // declare + initialize
System.out.println(marks[0]); // access element
System.out.println(marks.length); // array lengthTopics:
- 1D and 2D arrays
- Iterating over arrays
- Common array operations (find max, sum, reverse)
// Defining a method
public static int add(int a, int b) {
return a + b;
}
// Calling a method
int result = add(3, 4); // result = 7Topics:
- Parameters and return types
voidmethods (no return value)- Method overloading (same name, different parameters)
- Scope of variables
String s = "Hello, Java!";
s.length(); // 12
s.toUpperCase(); // "HELLO, JAVA!"
s.substring(0, 5); // "Hello"
s.contains("Java"); // true
s.replace("Java", "World"); // "Hello, World!"Topics:
- Common String methods
- String comparison (
equals()vs==) StringBuilderfor building strings efficiently- String formatting with
printf/String.format()
- Calculator (handles
+,-,*,/) - FizzBuzz (classic loop exercise)
- Simple number guessing game
- Basic student grade calculator
📁 See examples in my repo:
src/Basics/,src/Conditionals/,src/Loops/,src/Arrays/
OOP is Java's heart. This is what makes Java Java.
// Define a class
public class Dog {
String name; // field (attribute)
int age;
// Constructor
public Dog(String name, int age) {
this.name = name;
this.age = age;
}
// Method
public void bark() {
System.out.println(name + " says: Woof!");
}
}
// Create an object
Dog myDog = new Dog("Rex", 3);
myDog.bark(); // Rex says: Woof!public class BankAccount {
private double balance; // private = hidden
public double getBalance() { return balance; }
public void deposit(double amount) {
if (amount > 0) balance += amount;
}
}public class Animal {
public void eat() { System.out.println("Eating..."); }
}
public class Cat extends Animal { // Cat inherits from Animal
public void meow() { System.out.println("Meow!"); }
}
Cat cat = new Cat();
cat.eat(); // inherited from Animal
cat.meow(); // Cat's own methodAnimal a = new Cat(); // A Cat IS-AN Animal
a.eat(); // Works!public abstract class Shape {
public abstract double area(); // must be implemented by subclasses
}
public class Circle extends Shape {
double radius;
public double area() { return Math.PI * radius * radius; }
}public interface Flyable {
void fly(); // contract: any class implementing this must define fly()
}
public class Bird implements Flyable {
public void fly() { System.out.println("Flapping wings!"); }
}thiskeywordsuperkeywordstaticfields and methodsfinalclasses and methods- Access modifiers:
public,private,protected, (default) - Abstract classes vs interfaces
instanceofoperator
- Library book management system
- Simple bank account system
- Shape calculator (area/perimeter of circle, rectangle, triangle)
- Basic employee payroll system
📁 Check my repo:
src/OOP/– many solutions use OOP principles.
Java's built-in toolkit for storing groups of data.
import java.util.*;
// ArrayList — ordered, resizable list
List<String> fruits = new ArrayList<>();
fruits.add("Apple");
fruits.add("Mango");
fruits.remove("Apple");
// HashMap — key-value pairs
Map<String, Integer> ages = new HashMap<>();
ages.put("Alice", 25);
ages.put("Bob", 30);
int aliceAge = ages.get("Alice");
// HashSet — unique elements, no duplicates
Set<String> names = new HashSet<>();
names.add("Alice");
names.add("Alice"); // ignored — already existsLearn: ArrayList, LinkedList, HashMap, HashSet, TreeMap, Stack, Queue
try {
int result = 10 / 0; // throws ArithmeticException
} catch (ArithmeticException e) {
System.out.println("Can't divide by zero! " + e.getMessage());
} finally {
System.out.println("This always runs.");
}Topics:
- Checked vs unchecked exceptions
throwandthrows- Creating custom exceptions
- Common exceptions:
NullPointerException,ArrayIndexOutOfBoundsException,NumberFormatException
import java.io.*;
// Write to file
FileWriter writer = new FileWriter("notes.txt");
writer.write("Hello, File!");
writer.close();
// Read from file
BufferedReader reader = new BufferedReader(new FileReader("notes.txt"));
String line = reader.readLine();
reader.close();// A method that works with any type
public static <T> void printArray(T[] array) {
for (T element : array) {
System.out.print(element + " ");
}
}import java.util.*;
import java.util.stream.*;
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6);
// Filter even numbers, double them, collect to list
List<Integer> result = numbers.stream()
.filter(n -> n % 2 == 0)
.map(n -> n * 2)
.collect(Collectors.toList());
// result: [4, 8, 12]Topics:
- Lambda syntax:
(params) -> expression stream(),filter(),map(),reduce(),collect()- Functional interfaces:
Predicate,Function,Consumer
public enum Day { MON, TUE, WED, THU, FRI, SAT, SUN }
Day today = Day.MON;
if (today == Day.SAT || today == Day.SUN) {
System.out.println("Weekend!");
}- Contact book (store/search/delete contacts using
HashMap) - Word frequency counter (reads a file, counts word occurrences)
- Simple to-do list app (with file saving/loading)
- Student grade management system with sorting
📁 My repo examples:
src/LeetCode/uses many collections; alsosrc/Collections/.
This is what gets you through coding interviews at top companies.
| Structure | When to Use | Java Class |
|---|---|---|
| Array | Fixed-size, index access | int[], String[] |
| ArrayList | Dynamic list | ArrayList<> |
| LinkedList | Frequent insert/delete | LinkedList<> |
| Stack | LIFO (undo, backtracking) | Stack<> or Deque<> |
| Queue | FIFO (scheduling, BFS) | LinkedList<> or ArrayDeque<> |
| HashMap | Key-value lookup | HashMap<> |
| HashSet | Unique elements | HashSet<> |
| Tree | Hierarchical data | Build from scratch |
| Graph | Networks, paths | Build from scratch |
Sorting:
- Bubble Sort, Selection Sort, Insertion Sort (understand them)
- Merge Sort, Quick Sort (know these well — O(n log n))
Collections.sort()andArrays.sort()in Java
Searching:
- Linear Search — O(n)
- Binary Search — O(log n) — only on sorted arrays
Key Techniques:
- Two Pointers
- Sliding Window
- Recursion (understand the call stack!)
- Divide and Conquer
- Dynamic Programming (start simple: Fibonacci, coin change)
Understand how to measure algorithm efficiency:
| Complexity | Name | Speed |
|---|---|---|
| O(1) | Constant | Best |
| O(log n) | Logarithmic | Great |
| O(n) | Linear | Good |
| O(n log n) | Linearithmic | Okay |
| O(n²) | Quadratic | Avoid if possible |
| O(2ⁿ) | Exponential | Very bad |
Start easy and build up:
- HackerRank — Java-specific tracks for beginners
- LeetCode — Filter by "Easy" first; then "Medium"
- Codewars — Fun, gamified challenges
Goal: Solve 50–100 LeetCode problems before interviews.
📁 My LeetCode solutions: Browse
src/LeetCode/in my java_progress repo – categorized by pattern (Arrays, BinarySearch, Strings, TwoPointers, BitManipulation, Math).
Building real projects is what separates learners from developers.
- CLI Quiz App — Multiple choice questions, score tracking
- Expense Tracker — Add expenses, view summary, save to file
- Tic-Tac-Toe — Two-player game in the console
- Library Management System — Add/search/return books, store data in files
- Bank App — Accounts, deposits, withdrawals, transfer with OOP design
- Chat App (Console) — Multi-user text chat using basic networking
- REST API — Using Spring Boot (see Phase 6)
- Web Scraper — Using Jsoup library
- Simple Blog App — Spring Boot + MySQL database
💡 Tip: Put every project on GitHub. It becomes your portfolio.
- Maven or Gradle — Manage project dependencies (like npm in Node.js)
- Learn to read and write a
pom.xml(Maven) orbuild.gradle(Gradle)
Spring Boot is used in the majority of Java backend jobs. It lets you build web apps and REST APIs quickly.
@RestController
public class HelloController {
@GetMapping("/hello")
public String hello() {
return "Hello from Spring Boot!";
}
}Learn:
- REST APIs (GET, POST, PUT, DELETE)
@RestController,@GetMapping,@PostMapping- Spring Data JPA (connect to databases)
- Basic security concepts
- SQL basics —
SELECT,INSERT,UPDATE,DELETE,JOIN - MySQL or PostgreSQL — Free, widely used
- JDBC — Java's way to connect to databases
- Hibernate / JPA — ORM: work with databases using Java objects
Non-negotiable for any developer.
git init
git add .
git commit -m "Initial commit"
git push origin mainLearn: clone, add, commit, push, pull, branch, merge
import org.junit.jupiter.api.*;
class CalculatorTest {
@Test
void testAdd() {
Calculator calc = new Calculator();
assertEquals(5, calc.add(2, 3));
}
}- JUnit 5 — Java's standard testing framework
- Learn to write unit tests for all your methods
- Singleton — Only one instance of a class
- Factory — Create objects without specifying exact class
- Observer — Subscribe/notify pattern
- Builder — Construct complex objects step by step
| Resource | What It's Great For |
|---|---|
| docs.oracle.com/javase | Official Java tutorials |
| javatpoint.com | Quick concept references |
| w3schools.com/java | Beginners, simple examples |
| baeldung.com | Intermediate/advanced topics |
| Telusko (YouTube) | Great video tutorials in Java |
| Bro Code (YouTube) | Fast, beginner-friendly videos |
- Head First Java — Best beginner book, visual and fun
- Effective Java by Joshua Bloch — Read this after Phase 3
- Udemy: Java Masterclass by Tim Buchalka — Comprehensive, often on sale
| Day | Activity |
|---|---|
| Monday | Learn 1 new concept (read + watch) |
| Tuesday | Code examples from that concept |
| Wednesday | Solve 2–3 practice problems |
| Thursday | Build on your current project |
| Friday | Review the week's topics |
| Saturday | Longer coding session / mini-project |
| Sunday | Rest OR light review, plan next week |
- Copy-pasting code — Type it out. Your hands need to learn too.
- Tutorial hell — Watching videos without building anything. Code > consume.
- Skipping the basics — OOP confusion later almost always traces back to weak Phase 1.
- Not reading error messages — Errors are clues, not failures. Read them carefully.
- Giving up when stuck — Being stuck for 30 minutes on a bug is normal. It's how you learn.
- Not using Git — Start committing your code from Day 1.
- Trying to memorize syntax — Use it repeatedly and look things up. You'll remember naturally.
- Can write and run a Java program from scratch
- Understand variables, loops, conditions, methods
- Can work with arrays and Strings comfortably
- Can design a multi-class Java program
- Understand all four OOP pillars with examples
- Can use interfaces and abstract classes
- Comfortable with
ArrayList,HashMap,HashSet - Can handle exceptions properly
- Understand and can write lambda expressions
- Can implement common sorting/searching algorithms
- Solved 50+ coding problems
- Understand Big-O for common operations
- Built 2–3 real projects (on GitHub)
- Know Spring Boot basics
- Can write SQL queries
- Practiced 100+ LeetCode problems
- Have a GitHub profile with code
"The best time to start learning Java was yesterday. The second best time is right now."
Java is verbose, opinionated, and sometimes frustrating — and it's also one of the most stable, employable, and powerful languages in the world. Millions of Android apps, banking systems, and enterprise backends run on Java.
Every line you write today is an investment. Be patient with yourself. The confusion you feel right now is not a sign you're bad at this — it's a sign you're learning.
Now go write some code. ☕
Last updated: June 2026 | Covers Java 17–21 LTS
Accompanied by the java_progress repository — 173+ solved problems and growing.