Skip to content

Commit

Permalink
补充switch的使用
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunzhuo authored Nov 17, 2020
1 parent fe29962 commit 877c43f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion notes/Java 基础.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 406,7 @@ switch (s) {
}
```

switch 不支持 long是因为 switch 的设计初衷是对那些只有少数几个值的类型进行等值判断如果值过于复杂那么还是用 if 比较合适
switch 不支持 longfloatdouble是因为 switch 的设计初衷是对那些只有少数几个值的类型进行等值判断如果值过于复杂那么还是用 if 比较合适

```java
// long x = 111;
Expand Down

0 comments on commit 877c43f

Please sign in to comment.