Update Main.java

While loop added in static void main method