for.md 460 字节
Newer Older
湘王's avatar
湘王 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
# for循环结构

正确的for循环结构是:

## 答案

D

## 选项

### A

```Java

for (int i = 0; i < 10; i++) {
    System.out.println("Hello World");
}
```

### B

```Java

String[] arr = new String[] {"1", "2", "3"};
for (String str : arr) {
    System.out.println("Hello World");
}
```

### C

```Java

Map<String, String> map = new HashMap<>();
for (String str : map.keySet()) {
    System.out.println("Hello World");
}
```

### D

以上都是