I wrote the following class:
public class TestOne {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i < 100
With that semicolon you are saying that the for loop block is ending and there is no instructions inside.
Then you increment count just once and this is why the output is 1
public class TestOne {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i < 100; i++) ;
{
count++;
}
System.out.println(count);
}
}