Java exercises (with answers)