Beginner
Complete Java fundamentals: syntax, data types, operators, control flow, loops, arrays, strings, methods, OOP (classes, constructors, encapsulation, inheritance, abstract classes, interfaces), and exception handling.
Progress: 0 / 40 topics completed
Java Foundations
What is Java?
Learn what Java is, why it matters, and the key ideas that make it one of the most used programming languages in the world.
Setting Up Java
Install the JDK, choose an IDE, and get your development environment ready to write and run Java programs.
Hello World - Your First Program
Write and understand your first Java program: the anatomy of a class, the main method, and printing output.
How Java Works (JVM, JRE, JDK)
Understand the journey from Java source code to running program: the compiler, bytecode, and the Java Virtual Machine.
Comments in Java
Learn the three types of Java comments and when to use each one to make your code more readable.
Variables & Data Types
Variables
Learn how to declare, initialise, and name variables in Java - the containers that store data in your programs.
Primitive Data Types
Learn Java's eight primitive types - int, double, boolean, char, byte, short, long, and float - and when to use each.
The String Type
Learn how to create and concatenate Strings in Java, and understand why String is not a primitive type.
Type Casting
Learn how to convert between numeric types in Java using widening (automatic) and narrowing (explicit) type casting.
Constants (final keyword)
Use the final keyword to declare constants - values that can be set once and never changed.
User Input with Scanner
Read keyboard input from users using Java's Scanner class - nextLine, nextInt, nextDouble and more.
Operators
Arithmetic Operators
Perform calculations in Java using addition, subtraction, multiplication, division, modulus, and increment/decrement operators.
Comparison Operators
Compare values in Java using ==, !=, >, <, >=, and <= - operators that return a boolean result.
Logical Operators
Combine boolean conditions with && (AND), || (OR), and ! (NOT) to express complex logic.
Assignment Operators
Use compound assignment operators (+=, -=, *=, /=, %=) as shortcuts for updating variable values.
Control Flow
if / else Statements
Make decisions in your Java programs using if and else - the most fundamental control flow structure.
else if Chains
Handle multiple mutually exclusive conditions in sequence using else if to create a decision chain.
switch Statement
Match a single value against multiple cases using the switch statement - cleaner than long else-if chains for exact-value comparisons.
Ternary Operator
Write concise conditional expressions with Java's ternary operator: condition ? valueIfTrue : valueIfFalse.
Loops
for Loop
Repeat code a fixed number of times with Java's for loop - the most common loop for counting and iteration.
while Loop
Repeat code while a condition is true - ideal when the number of iterations is not known in advance.
do-while Loop
Execute code at least once, then repeat while a condition holds - the do-while loop guarantees the first iteration always runs.
for-each Loop
Iterate over arrays and collections cleanly with the enhanced for loop (for-each) - no index management required.
break and continue
Control loop execution precisely with break (exit the loop) and continue (skip to the next iteration).
Arrays
Arrays
Store multiple values of the same type in a fixed-size array - declare, initialise, access, and iterate.
Multidimensional Arrays
Work with 2D arrays (tables/matrices) in Java - declare, initialise, access, and iterate using nested loops.
The Arrays Class
Use java.util.Arrays to sort, search, fill, copy, and print arrays without writing boilerplate loops.
Working with Strings
String Methods
Master the most useful String methods in Java - length, charAt, substring, indexOf, replace, split, contains, and more.
StringBuilder
Build and modify strings efficiently using StringBuilder - the mutable alternative to immutable String.
String Formatting
Format numbers, text, and dates precisely using String.format(), printf(), and formatted() with format specifiers.
Methods
Defining Methods
Write reusable blocks of code with Java methods - define, call, pass parameters, and return values.
Method Overloading
Define multiple methods with the same name but different parameters - Java uses the argument types to choose the right version.
Recursion
Solve problems by having a method call itself - understand the base case, recursive case, and call stack.
Object-Oriented Programming
Classes and Objects
Learn the foundations of OOP in Java - define classes as blueprints and create objects (instances) from them.
Constructors
Initialise objects properly using constructors - special methods that run when an object is created with new.
Encapsulation
Protect object data with private fields and expose it safely through public getters and setters.
Inheritance
Reuse and extend existing classes using extends - build class hierarchies where child classes inherit fields and methods from parent classes.
Abstract Classes
Define incomplete class templates with abstract methods that subclasses must implement, enforcing a shared contract.
Interfaces
Define contracts that classes must fulfill using interfaces - Java's way of achieving multiple inheritance and loose coupling.
Exception Handling
Handle runtime errors gracefully with try-catch-finally, throw exceptions, and understand checked vs unchecked exceptions.