I am currently working on a program that examines each line in a text document, and does the same modifications to it. However, the for loop is only looping through once rather than the needed 5 times. Below is the portion of the code that is not working.
//I think this part is correct but I decided to include it just in case.
Scanner infile = null;
try {
infile = new Scanner(new File("solution.txt"));
} catch(FileNotFoundException e) {
System.out.println(e);
System.exit(0);
}
for(int i = 0; i < 5; i++);
{
s = infile.nextLine();
System.out.println(s);
System.out.println("LOOP"); //Just a debug test
}
infile.close();
The output of this code is the following:
define 88 as INT
LOOP
Whereas it should be:
define 88 as INT
LOOP
define 89 as INT
LOOP
define 90 as INT
LOOP
define 91 as INT
LOOP
define 92 as INT
LOOP