Could someone help me figure out why my program won't input the data back onto the screen after it output it onto a text file
Thanks
import java.io.IOException; import java.io.PrintWriter; import java.io.File; import java.util.Scanner; import java.util.Random; public class BottleCapPrize { public static void main(String[]args) throws IOException { PrintWriter outFile = new PrintWriter(new File("MonteCarlo.txt")); Scanner inFile = new Scanner(new File("MonteCarlo.txt")); Random randNum = new Random(); int bottleCapNum = 0; int wins = 0; int bottleCapInput = 0; int token; Scanner userInput = new Scanner (System.in); // System.out.print("Please enter the number of trials: "); int uInput = userInput.nextInt(); for (int counter = 1; counter <= uInput; counter++) { int randNum1 = 0; while (randNum1 != 1) { randNum1 = randNum.nextInt(5); System.out.println("randNum1 = " + randNum1); bottleCapNum++; } wins++; bottleCapNum++; System.out.println("Counter = " + counter + " bottleCapNum = " + bottleCapNum + " wins = " + wins); outFile.println(bottleCapNum); } outFile.close( ); while(inFile.hasNextInt()); { token = inFile.nextInt(); System.out.println(token);} inFile.close(); } }