Examples and exercises used in teaching Java