Update textAdventure.java

updated the java method