Skip to main content
Tutorial 2 Practice Portal

Practise object-oriented reasoning, one small step at a time

Two short practices for Tutorial 2. Work through a sequence of small tasks — read a class diagram, declare state, write a constructor, and coordinate objects from an application class — with checks and hints at every step. No account needed; your progress stays in this browser.

You'll practise

  • Private state vs. public behaviour
  • Constructors and valid initial state
  • Accessors, mutators, and computed values
  • Independent objects of the same class
  • Coordinating objects from an application class
  • Handling invalid input gracefully

Circle

Model a circle as an object with private state, a class constant, a constructor, accessors and mutators, and computed behaviour. Coordinate the object from a small application class.

0/10
Start practice

Dice

Model a single die as an object with a bounded random state, then coordinate two independent dice from an application class that computes their total.

0/7
Start practice

This is an early interaction prototype: check results are generated locally in your browser to demonstrate the workflow, not by compiling and running real Java yet. See About for details.