if.md 472 字节
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 43 44 45
# if结构

能正确打印出 `CSDN` 的代码是:

## 答案

B

## 选项

### A

```java

int count = 0;
if (1 = count) {
    System.out.println("Hello World");
}
```

### B

```java

int count = 0;
if (1 == count) {
    System.out.println("Hello World");
} else
    System.out.println("CSDN");
```

### C

```java

String name = "CSDN";
if ("CSDN" != name) {
    System.out.println("CSDN");
} else
    System.out.println("Hello World");
```

### D

以上都不是