Updated Main.java

Added a for loop.