Hi there, I'm an absolute beginner on Java. I wrote the following piece of code. I ran it and it gives the output as 1.
Since 1 is not greater than 10, it should NOT execute the println at all. But why value i is printed. Can someone explain me why?
public class While_Loop {
public static void main(String[] args) {
int i=1;
while (i>10);
{
System.out.println(i);
i=i+1;
}
}
}