Java for Complete Beginners
Write real Java programs and understand objects, not just syntax
One payment of $39. Instant online access to the full written course. No subscription. Refund policy.
You write real Java programs and understand objects, not just syntax. You build one project, Shelf, a text-based book tracker whose data is saved to a file, and you finish able to explain how each class in it works and why it is built that way.
Who it is for. Complete beginners who have never programmed, and people who tried Java before and got lost in the terms. You do not need any maths beyond everyday arithmetic. You should be comfortable making folders and files on your computer.
You finish with. Shelf: a text-based book tracker with saved data. Build Shelf, a menu-driven Java program that tracks the books you own or borrow, records reading progress and ratings, shows statistics, and saves everything to a file so it is still there the next time you run it. Your project uses classes, inheritance, an interface, an enum, collections, exceptions and file handling, and it comes with automatic checks.
Certificate. Finish every lesson, resolve every quiz question with at least 50% right on the first try, and tick the capstone checklist — Apex Flow Academy issues a verifiable Certificate of Completion with a unique ID and a public verification page. It is a certificate of completion, not a degree, licence, accreditation or exam result.
01 · Meet Java: Run Your First Programs4 lessons
Set up Java, learn how a program is built and run, store numbers and text in variables, and print a formatted book card. This is the first piece of your Shelf project.
- 1.1How Java Code Becomes a Running ProgramFREE
- 1.2The Parts of a Program and How to Read Errors
- 1.3Variables and Numbers
- 1.4Text: Working with Strings
02 · Decisions, Loops and Input4 lessons
Teach your programs to choose, to repeat, and to listen. You finish with a menu-driven Shelf counter that asks you questions and keeps running until you quit.
- 2.1Making Decisions with if and else
- 2.2Many Choices: else if and switch
- 2.3Repeating Work with Loops
- 2.4Asking the User: Scanner and the Menu Loop
03 · Organizing Code and Data4 lessons
Split your program into named methods, then store many values at once with arrays, lists and maps. You finish with a Shelf that remembers every book while it runs.
- 3.1Methods: Name a Job Once, Use It Anywhere
- 3.2Arrays: A Fixed Row of Values
- 3.3ArrayList: A List That Grows
- 3.4HashMap: Look Things Up by Key
04 · Objects: Your Own Types4 lessons
Stop juggling parallel lists. Build a Book class that keeps its own facts together, protect its data, and manage a whole shelf of Book objects with search and sorting.
- 4.1Classes and Objects: Your Own Types
- 4.2Methods in Objects, this and static
- 4.3Encapsulation: Protect Your Data
- 4.4Lists of Objects: Search, Filter and Sort
05 · Objects That Work Together4 lessons
Grow Shelf with inheritance, interfaces, enums and exceptions. You add borrowed books, a fixed set of reading statuses, and input that survives typing mistakes.
- 5.1Inheritance: A Class That Builds on Another
- 5.2Interfaces and Polymorphism
- 5.3Enums: A Fixed Set of Choices
- 5.4Exceptions: Handling Things That Go Wrong
06 · Save Your Data and Finish Shelf4 lessons
Write and read files, turn objects into lines of text and back, check your work with tests, and assemble the finished Shelf app that remembers your books between runs.
- 6.1Reading and Writing Files
- 6.2Saving and Loading the Shelf
- 6.3Checking Your Code with Tests and Debugging
- 6.4Capstone: Assemble, Run and Share Shelf
How Java Code Becomes a Running Program
You will be able to
- Say what compiling and running mean in Java.
- Check your setup and run a program with
javacandjava.
Why this matters
Every program in this course goes through the same two steps. Once you know what each step does, the most common first-day errors stop being a mystery. You also meet Shelf here. Shelf is the project you build across all six modules. It is a text app that tracks books you own, borrow and read, and saves them to a file so they are still there tomorrow.
Here is how to use the course. Every lesson has the same six parts, so you always know where you are. Type the examples yourself instead of pasting them. Then do the task at the end and take the short quiz. Each module ends with a piece of Shelf, and the last module puts the pieces together.
Learn it
Java code is plain text in a file that ends in .java. This text is called source code. A computer cannot run source code directly, so two tools turn it into action.
The compiler, javac, reads your source file and checks it for mistakes. If it finds none, it writes a .class file. That file holds bytecode, a compact set of instructions. This step is called compiling.
The Java Virtual Machine, started by the java command, reads the .class file and carries out the instructions. This step is called running.
Both tools come in the JDK, the Java Development Kit. A plain runtime (a JRE) can run programs but cannot compile them, so you need the JDK. This course works with Java 17 or newer.
Check your setup:
- Open a terminal. On Windows, search for Command Prompt or PowerShell. On a Mac, open Terminal.
- Type
javac -versionand press Enter. - If you see something like
javac 21.0.4, you are ready. Any number from 17 up is fine. - If you see "not recognized" or "command not found", install a free JDK. Eclipse Temurin from adoptium.net is one free choice. Check its download page for the current versions and the installer for your system.
- During the install, look for an option that adds Java to your PATH. The PATH is the list of places your terminal searches for programs. Turn it on. If your screen looks different, look for the word PATH.
- Close the terminal, open a new one, and repeat step 2.
See it in action
Make a folder called shelf. Inside it, create a file named Hello.java with this text:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, Shelf!");
}
}Open your terminal in that folder and run two commands:
javac Hello.java
java HelloThe first command prints nothing when it works, but a new file, Hello.class, appears. The second command prints:
Hello, Shelf!You can also run java Hello.java. Since Java 11, that form compiles in memory and runs in one step. It was built for a single file, so from Module 4 we use javac on several files at once. That works in every version.
Common mistakes
- Typing
java Hello.class. Thejavacommand wants the class name only, so you get "Could not find or load main class". Typejava Hello. - A file name that does not match the class name. The compiler says
class Hello is public, should be declared in a file named Hello.java. Rename the file, capital letters included. - Running commands in the wrong folder. Use
cd shelfto move into your folder first.
If this is not working: when javac is not recognized, the JDK is missing or the PATH option was off, so reinstall and open a new terminal. When java works but javac does not, you only have a runtime, so install a JDK. When an old version prints, an older Java comes first on your PATH.
You are done when
You saw Hello, Shelf! in your own terminal. You can also say in one sentence what javac does and what java does.
You finished the free lesson
That is one lesson from the course. The full course gives you every remaining lesson, a quick check and a hands-on task in each one, and the workbook of templates and checklists.
Full course$39
- A computer running Windows, macOS or Linux. Plan on roughly nine hours of study plus practice time, spread however suits you.
- A JDK (Java Development Kit), version 17 or newer. It is free. Eclipse Temurin from adoptium.net is one free choice, and other free builds work too. Check the current download page for versions and the installer for your system.
- A terminal that is already on your computer: Command Prompt or PowerShell on Windows, Terminal on macOS, or a shell on Linux.
- A text editor. Any plain editor works. Visual Studio Code is a free choice. A free Java IDE such as the Eclipse IDE also works; check each tool's current features and terms.
- Nothing in this course requires a paid tool or subscription.
- No programming experience is needed.
- You can create folders and text files and open a terminal or command prompt. Lesson 1.1 shows you how to check your setup.
Shelf: a text-based book tracker with saved data
Build Shelf, a menu-driven Java program that tracks the books you own or borrow, records reading progress and ratings, shows statistics, and saves everything to a file so it is still there the next time you run it. Your project uses classes, inheritance, an interface, an enum, collections, exceptions and file handling, and it comes with automatic checks.
- The source files: Status.java, Describable.java, Book.java, BorrowedBook.java, Shelf.java, ShelfFile.java, ShelfApp.java and ShelfChecks.java.
- The output of java ShelfChecks showing All checks passed, including at least two checks you wrote yourself.
- A text file of six numbered acceptance results: fresh start, add and log reading, restart and reload, damaged data file, mistyped numbers, and a run from the packaged jar.
- shelf.jar, built with jar --create and --main-class, that starts with java -jar shelf.jar.
- Source code
- The text you write in a .java file. People can read it, but the computer cannot run it directly.
- Compiler (javac)
- The tool that checks your source code for mistakes and turns it into a .class file.
- Bytecode
- The compact set of instructions inside a .class file. Java runs it for you.
- JVM (Java Virtual Machine)
- The program, started with the java command, that reads a .class file and carries out its instructions.
- JDK
- The Java Development Kit. It holds the compiler and the tools you need to write and run Java. A plain runtime cannot compile.
- PATH
- The list of folders your terminal searches when you type a command. Java must be on it for javac to be found.
- Variable
- A named place that holds one value, such as a page count.
- Type
- The kind of value a variable holds, such as int for whole numbers or String for text.
- Cast
- Turning a value into another type on purpose, as in (double) pages.
- String
- Text in double quotes. A String never changes; its methods give back new Strings.
- Method
- A named block of code that does one job. You call it by name and it can give back a value.
- Parameter
- A value a method needs, listed in its parentheses. It is a copy of what the caller passes in.
Browse the full Academy encyclopedia
32 checks were run and recorded while writing this course (code, formulas, commands and facts), and it lists 10 official sources it was checked against. Prices, features and policies of outside tools can change, so check each tool's own website.
Created by Apex Flow Academy with AI assistance. For education only; not legal, tax, financial or medical advice. Results depend on your effort and circumstances.
Python From Zero: Write Programs That Work
You write and run real Python programs from the first lesson, and you finish with three small working tools that you built yourself, tested with checks you wrote, and can change without starting over.
Python Automation: Make the Computer Do Your Boring Work
You automate files, spreadsheets, email drafts and web lookups that eat your week. You finish with your own script that plans before it acts, keeps a log, is tested against sample data, and runs on a schedule.
SQL: Ask Any Database Any Question
You will be able to write SQL that answers business questions from a database: choose and sort columns, filter rows, summarise and group, join tables, and check that your numbers are right. You finish with a report you built and checked yourself.