Java基础 -4.4

For循环
for循环也是一种常规的使用结构

	public static void main(String[] args) {
		for(定义循环的初始值;循环判断;修改循环条件) {
			循环语句的执行;
		}
	}

对于while和for循环的选择只有一个参考标准:

  • 在明确确定循环次数的情况下优先使用for循环
  • 在不知道循环次数但是知道循环结束条件的情况下使用while循环
原文地址:https://www.cnblogs.com/sakura579/p/12313456.html