public class ContinueGotcha {
public static void main(
String[] args){
for(byte i =0 ; i<10;
i++){
System.out.println("Value of i = " + i);
}}}
Why the above code works fine and below one not. Only difference is increment difference in for loop.
public class ContinueGotcha {
public static void main(String[] args){
for(byte i =0 ; i<10;
i=i+1){
System.out.println("Value of i = " + i);
}}}
Can someone explain me in detail . Thanks in advance. I was thinking that both will not work but the above code is working.