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.
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.
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.