Java Advanced

OOP: classes, inheritance, interfaces and collections.

3 lessons 5 tasks ⚡ Live compiler
Lessons Compiler Quiz Certificate

📚 Lessons

1 Classes & objects

A class defines fields and methods; objects are instances created with new. Constructors initialise state.

class Account {
  private double balance;
  Account(double b) { balance = b; }
  void deposit(double a) { balance += a; }
  double getBalance() { return balance; }
}

2 Inheritance & interfaces

extends shares behaviour between classes; an interface defines a contract that implementers must fulfil — enabling polymorphism.

interface Shape { double area(); }
class Circle implements Shape {
  double r;
  public double area() { return 3.14159 * r * r; }
}

3 Collections

The Collections Framework provides ArrayList, HashMap and HashSet — dynamic, generic data structures. (The runnable example below sums a range.)

public class Main {
    public static void main(String[] args) {
        long sum = 0;
        for (int i = 1; i <= 100; i++) sum += i;
        System.out.println("sum 1..100 = " + sum);
    }
}

⚡ Java Compiler

Code runs on a learning-oriented simulated runtime that supports common constructs (output, variables, arithmetic, conditionals and loops).

JAVA

            

📝 Tasks

5 tasks across 2 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.

🎓 Certificate of Completion

🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.