Build a Java Console Project: A To-Do App (Step by Step)
Build your first real Java project: a menu-driven console To-Do app. Step by step with classes, ArrayList, Scanner input, and a clean menu loop — no frameworks needed.
Time to build your first real Java project — a console-based To-Do List app. It's the perfect starter: no frameworks, no database, just pure Java putting together everything from the Core Java course. By the end you'll have a working program you can run, understand fully, and put on GitHub. Let's build it step by step.
Scanner, and a clean menu-driven structure. These fundamentals show up in every Java program you'll ever write.
What we're building
A menu-driven To-Do app that lets the user add tasks, list them, mark them done, delete them, and exit — all in the console. Simple, but it exercises real program structure.
Step 1: Model a Task
Start with a class representing one task. This is classes & objects and encapsulation in action:
class Task { private String title; private boolean done; Task(String title) { this.title = title; this.done = false; } public String getTitle() { return title; } public boolean isDone() { return done; } public void markDone() { this.done = true; } @Override public String toString() { return (done ? "[x] " : "[ ] ") + title; } }
Step 2: Set up the app and a task list
We'll keep tasks in an ArrayList and read input with a Scanner:
import java.util.*; public class TodoApp { static List<Task> tasks = new ArrayList<>(); static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { boolean running = true; while (running) { printMenu(); int choice = Integer.parseInt(scanner.nextLine()); switch (choice) { case 1 -> addTask(); case 2 -> listTasks(); case 3 -> completeTask(); case 4 -> running = false; default -> System.out.println("Invalid choice"); } } System.out.println("Goodbye!"); } }
Notice the menu loop — a while loop that keeps showing options until the user exits. This is the backbone of almost every console app.
Step 3: Write the feature methods
Each menu option is its own method — clean, readable, and easy to test. This is good method design:
static void printMenu() { System.out.println("\n1) Add 2) List 3) Complete 4) Exit"); System.out.print("Choose: "); } static void addTask() { System.out.print("Task title: "); String title = scanner.nextLine(); tasks.add(new Task(title)); System.out.println("Added!"); } static void listTasks() { if (tasks.isEmpty()) { System.out.println("No tasks yet."); return; } for (int i = 0; i < tasks.size(); i++) { System.out.println((i + 1) + ". " + tasks.get(i)); } } static void completeTask() { listTasks(); System.out.print("Number to complete: "); int n = Integer.parseInt(scanner.nextLine()); if (n >= 1 && n <= tasks.size()) { tasks.get(n - 1).markDone(); System.out.println("Done!"); } else { System.out.println("Invalid number"); } }
Step 4: Run it
Compile and run from your IDE or the terminal:
javac TodoApp.java Task.java java TodoApp
Add a few tasks, list them, mark one done, and watch the [x] appear. You just built a complete, interactive program from scratch. 🎉
Level it up (great for your portfolio)
Once the basics work, extend it — each addition teaches something new:
- Delete a task — practise
ArrayList.remove(). - Save to a file so tasks persist between runs — learn File I/O.
- Add input validation — handle non-number input with try/catch.
- Add priorities or due dates — use the Date & Time API.
My honest advice: type this out yourself rather than copy-pasting, and then break it on purpose — enter letters where it expects a number, choose task 99, leave the title blank. Watching it fail and then fixing it teaches you more than the happy path ever will. This little To-Do app is exactly the kind of project I built when starting out, and the menu-loop-plus-methods structure here scales up: it's the same shape as far bigger programs. Finish it, add one extra feature, push it to GitHub with a README — and you've got a real project to talk about. Then move up to Spring Boot projects.