Java Small Exercise from A to Z