Adding how to while loop in JAVA