GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — toBeTopJavaer/basics/java-basic/enum-compare.md at master · yangjunhui710/toBeTopJavaer Expand file tree/ Copy pathenum-compare.mdMore file actions 7 lines (4 loc) · 362 Bytes / Copy pathenum-compare.mdFile metadata and controls7 lines (4 loc) · 362 Bytes 1 2 3 4 5 6 7 java 枚举值比较用 == 和 equals 方法没啥区别,两个随便用都是一样的效果。 因为枚举 Enum 类的 equals 方法默认实现就是通过 == 来比较的; 类似的 Enum 的 compareTo 方法比较的是 Enum 的 ordinal 顺序大小; 类似的还有 Enum 的 name 方法和 toString 方法一样都返回的是 Enum 的 name 值。 |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |