Java syntax homework