THE FORSK PRACTICE ROOM
Build your Java foundations
Ten original Java lessons with complete programs, expected output and practice exercises.
Open lessons. No sign-up needed. Learn at your own pace.
CHOOSE YOUR NEXT TOPIC
10 lessons to work through
10 lessons
Java program structure: from source file to output
Run a complete Java program, trace main and a named method, and separate compile errors from incorrect results.
Java variables and operators: totals without truncation
Choose numeric types deliberately, understand integer division, and calculate a small invoice using whole paise.
Java control flow: validate, filter and count marks
Combine if, a loop and continue to process marks while making boundary decisions explicit.
Java classes and objects: model two independent scorecards
Create objects with constructors and see how separate instances hold separate state.
Java inheritance and polymorphism: dispatch the right behaviour
Use a base type to process different notification objects and see which overridden method executes.
Java interfaces: swap a formatter without changing the caller
Implement a small interface using ordinary named classes and pass different implementations to the same method.
Java encapsulation: protect a wallet balance
Keep state private and expose operations that preserve a simple, testable invariant.
Java List, Set and Map: choose the right collection
Compare repeated values, uniqueness and key-based lookup with deterministic output.
Java Iterator: remove matching elements safely
Remove failing marks through an ArrayList iterator and understand why direct structural changes during iteration are a problem.
Java exception handling: recover from one invalid input
Catch NumberFormatException at an input boundary while allowing later valid records to be processed.
No lessons match that search. Try a shorter topic name.
Build a learning habit that leaves evidence.
Save your working code, write down the mistake you corrected, and return to the exercise a day later. For guided classroom or online learning, explore the related Forsk courses.
Explore guided learning →