Question: The following program has two separate errors, each of which would cause an infinite loop. As a member of the inspection team, you could save

The following program has two separate errors, each of which would cause an infinite loop. As a member of the inspection team, you could save the programmer a lot of testing time by finding the errors during the inspection. Can you help?

public class TryIncrement {

public static void main(String[] args) throws IOException {

int count = 1;

while(count < 10)

System.out.println(" The number after " + count); /* Nowwe will

count = count + 1; add 1 to count */

output.println(" is " + count);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!