The Complete Java Learning Guide

Java is a general-purpose, statically typed programming language used for applications, services, Android development, and large software systems.

How Java works

Java source code is compiled into bytecode that runs on a Java Virtual Machine (JVM). Types are checked as code is compiled, and the runtime manages memory for objects.

What you will learn

You will start with a small class and main method, then learn types, control flow, object-oriented design, collections, exceptions, and application structure.

How to use this guide

  1. Start with Chapter 1 and move through the chapters in order. New ideas build on the earlier ones.
  2. Type each example yourself, make a small change, and predict what will happen before running it.
  3. When a chapter is ready, its lesson will appear at the chapter link. These pages are currently blank lesson starters.

A step-by-step learning path

  1. Chapters 1-7: Learn to write instructions. Compile a first program, use typed variables, work with input and output, make decisions, repeat tasks, and write methods.
  2. Chapters 8-12: Work with collections and objects. Use arrays and lists, process strings, understand references, manage resources, and design classes and other types.
  3. Chapters 13-18: Organize and verify applications. Learn scope, packages, the Java libraries, files, exceptions, debugging, and tests.
  4. Chapters 19-24: Grow into larger programs. Study algorithms, advanced Java features, safe and efficient design, build tools, and guided projects.

Java ideas you will meet early

Your first Java program

Save this class in a file named Hello.java:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

Hello is the class name and matches the file name. The main method is where this simple program starts. System.out.println displays a line of text. With a Java Development Kit installed, compile and run it from the file's folder:

javac Hello.java
java Hello

A simple way to study

First file: save your first program as Hello.java. Compile with javac Hello.java, then run with java Hello.

Course chapters

Follow the 24 chapters in order, or choose a topic to revisit. Each chapter opens its own lesson page.

  1. What Java is and how a program runs
  2. Your first program
  3. Values, types, and variables
  4. Input and output
  5. Expressions and operators
  6. Decisions and loops
  7. Functions and program structure
  8. Collections: arrays, lists, and slices
  9. Strings and text
  10. References, pointers, and memory
  11. Memory and resource management
  12. User-defined types and data modeling
  13. Scope, lifetime, and visibility
  14. Modules, imports, and declarations
  15. Multi-file programs, packages, and libraries
  16. The standard library and ecosystem
  17. File input and output
  18. Errors, debugging, and testing
  19. Data structures and algorithms
  20. Advanced language topics
  21. Safety, portability, and performance
  22. Build systems and professional workflow
  23. A project ladder
  24. Further study checklist
0% read