×

Loading...

Are the following 4 pieces of code equivalent to each other?

jabber (jabber)
1) for(int i=0; i<10; i++) {
System.out.println("i =" +i);
}
2) for(int i=0; i<10; ++i) {
System.out.println("i =" +i);
}
3) for(int i=0; i<10; ) {
System.out.println("i =" +i);
i++;
}
4) for(int i=0; i<10; ) {
System.out.println("i =" +i);
++i;
}

The question is: Are the above 4 pieces of code equivalent to each other? Can anybody tell me why? Thank you so much.
(#9387@0)
2000-9-26 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: Are the following 4 pieces of code equivalent to each other?

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT杂谈