📜  对于具有两个值的 java 代码示例

📅  最后修改于: 2022-03-11 14:52:34.408000             🧑  作者: Mango

代码示例1
public class forloop {
    public static void main(String[] args) {
        // for loop with two variable i & j
        // i will start with 0 and keep on incrementing till 10
        // j will start with 10 and keep on decrementing till 0
        for (int i = 0, j = 10; i < 10 && j > 0; i++, j--) {
            System.out.println("i = " + i + " :: " + "j = " + j);
        }
    }
}