Skip to main content

Section 01 ยท Stage 1: Learn Java

Java Basics

Foundational programming from zero: syntax, variables, operators, conditionals, loops, methods, arrays, strings, and exceptions.

What you will learn

  1. 1.1Getting Started7 lessons

    What Java is, what the JDK, JRE and JVM are, how to install Java, how to set up one IDE (VS Code, IntelliJ IDEA or Eclipse), and how to write and run your first program.

    1. What is Java?10 min
    2. JDK, JRE and JVM10 min
    3. Install Java (JDK) on your computer20 min
    4. Set up VS Code for Java20 min
    5. Set up IntelliJ IDEA for Java20 min
    6. Set up Eclipse for Java20 min
    7. Your first Java program20 min
  2. 1.2Variables & Data Types9 lessons

    Store values in variables, meet Java's data types (int, long, double, float, char, boolean and String), convert between types, make constants with final, and fix common beginner mistakes.

    1. What is a variable?16 min
    2. Data types in Java15 min
    3. Whole numbers: int and long16 min
    4. Decimal numbers: double and float16 min
    5. char and boolean14 min
    6. Text with String18 min
    7. Type conversion and casting22 min
    8. Constants with final12 min
    9. Common mistakes and practice28 min
  3. 1.3Operators8 lessons

    Do calculations with arithmetic operators, change variables with =, +=, ++ and --, compare values, join conditions with &&, || and !, pick one of two values with ?:, and learn the order Java runs operators in.

    1. Arithmetic operators22 min
    2. Assignment and compound assignment18 min
    3. Increment and decrement: ++ and --20 min
    4. Comparison operators20 min
    5. Logical operators: &&, || and !22 min
    6. The ternary operator ?:14 min
    7. Operator precedence and parentheses20 min
    8. Common mistakes and practice28 min
  4. 1.4Input & Output7 lessons

    Print output with println, print and printf, read keyboard input with Scanner, choose between next() and nextLine(), fix common input errors, and build small console programs.

    1. Printing with println and print15 min
    2. Formatted output with printf20 min
    3. Reading input with Scanner18 min
    4. Reading numbers, words and characters18 min
    5. next() vs nextLine() and the Enter key20 min
    6. Common input errors16 min
    7. Mini programs and practice30 min
  5. 1.5Conditional Statements9 lessons

    Make decisions in Java with if, if-else and else-if ladders, join checks with && and ||, nest one if inside another, pick a case with switch and arrow switch expressions, and fix common condition bugs.

    1. The if statement15 min
    2. if-else: choose one of two paths16 min
    3. The else-if ladder20 min
    4. Combine conditions with && and ||22 min
    5. Nested if18 min
    6. The switch statement22 min
    7. switch with arrows (->)18 min
    8. Common mistakes and practice32 min
    9. Must-do problems: Conditional Statements120 min
  6. 1.6Loops8 lessons

    Repeat code with loops: write for, while and do-while loops, trace a loop to find totals and counts, stop or skip rounds with break and continue, print patterns with nested loops, and fix common loop mistakes.

    1. Why loops?14 min
    2. The for loop22 min
    3. Tracing a loop: totals and counts26 min
    4. while and do-while loops30 min
    5. break and continue22 min
    6. Nested loops and star patterns30 min
    7. Common mistakes and practice35 min
    8. Must-do problems: Loops150 min
  7. 1.7Methods10 lessons

    Split a program into small methods: define and call a method, send values in with parameters, get a result back with return, understand local variables and pass-by-value, overload a method, start with recursion, and fix common method mistakes.

    1. Why use methods?14 min
    2. Define and call a method18 min
    3. Parameters and arguments20 min
    4. Return a value from a method22 min
    5. Local variables and scope20 min
    6. Pass-by-value: a method gets a copy16 min
    7. Method overloading18 min
    8. Recursion: a method that calls itself22 min
    9. Common mistakes and practice35 min
    10. Must-do problems: Methods150 min
  8. 1.8Arrays11 lessons

    Store many values in one variable with arrays: create an array, read and change elements by index, loop through it with for and for-each, find totals, largest values and matches, pass arrays to methods, use 2D arrays and the Arrays class, and fix common array mistakes.

    1. What is an array?14 min
    2. Creating an array18 min
    3. Reading and changing array elements20 min
    4. Looping through an array22 min
    5. The for-each loop18 min
    6. Sum, average, largest and search28 min
    7. Arrays and methods25 min
    8. 2D arrays: rows and columns25 min
    9. The Arrays class: print, sort and compare20 min
    10. Common mistakes and practice35 min
    11. Must-do problems: Arrays150 min
  9. 1.9Strings11 lessons
  10. 1.10Exception Basics9 lessons

    Handle runtime errors so a program does not crash: read a stack trace, recognise common exceptions, use try, catch and finally, throw an exception and declare it with throws, and keep asking until the user types valid input. Custom exception classes come later in the OOP section.

    1. What is an exception?15 min
    2. Common exceptions you will see18 min
    3. Handle an exception with try and catch20 min
    4. Multiple catch blocks18 min
    5. The finally block16 min
    6. throw and throws22 min
    7. Keep asking until the input is valid20 min
    8. Common mistakes and practice30 min
    9. Must-do problems: Exception Basics150 min
  11. 1.11Packages, Imports & Access Control6 lessons

    Organize Java classes into packages: see why packages exist, create your own package and run it, use classes from other packages with import, control who can use a class, field or method with public, private and default access, and build a small app from two packages.

    1. Why do we need packages?12 min
    2. Create your own package18 min
    3. Use classes from other packages with import22 min
    4. Access modifiers: public, private and default22 min
    5. Build an app with two packages22 min
    6. Common mistakes and practice30 min
  12. 1.12Java Basics Mini Projects5 lessons

    Put Java Basics together in five small console projects: a calculator, a number guessing game, a student marks report, a text analyzer and an ATM simulator. Each project is built step by step, pushed to GitHub and submitted as a link.

    1. Build a simple calculator40 min
    2. Build a number guessing game40 min
    3. Build a student marks report50 min
    4. Build a text analyzer50 min
    5. Build an ATM simulator60 min