我很困惑for循环,在“测试计数器”为什么它使用小于(jerry < tom.length)..?for循环 - 测试计数器 - 为什么它使用小于
public static void main (String args[]) {
int tom[] = {1, 2, 3, 4, 5};
for (int jerry=0; jerry<tom.length; jerry++)
{
System.out.println(jerry+ "\t" +tom[jerry]);
} }
你以为它会用什么呢? – JJJ
如果使用'>',循环将永远不会执行。 – mr5
不一定:[有些人更喜欢'!=',原因很好](http://stackoverflow.com/questions/1783822/format-of-for-loops/8884617#8884617)。 – dasblinkenlight