Java Coding Question For Automation Game