当前位置:网站首页>switch case使用枚举类来比较
switch case使用枚举类来比较
2022-06-11 00:49:00 【绅士jiejie】
参考代码如下:
//通过valueOf方法获取到具体的枚举,这个type就是真实传进来的要匹配的参数
Enum enum = Enum.valueOf(type);
//switch里的匹配项就是以上得出的枚举
switch (enum) {
//这里的case匹配条件就用我们定义好的枚举实例来做匹配
case enum1:
case enum12:
...}
边栏推荐
- 2021-2-26 compilation of programming language knowledge points
- 【BSP视频教程】BSP视频教程第17期:单片机bootloader专题,启动,跳转配置和调试下载的各种用法(2022-06-10)
- Win11怎么更改管理员头像?Win11更换管理员头像的方法
- [error record] Android application security detection vulnerability repair (strandhogg vulnerability | set activity component android:taskaffinity= "")
- [leetcode] intersecting linked list
- Task02: basic use of database (MySQL)
- Today's sleep quality record 80 points
- Basic underlying principles of concurrent programming (4)
- 【MATLAB】图像增强(幂次变换、直方图规定化处理方法、平滑、锐化滤波)
- flutter 状态管理
猜你喜欢

【云原生 | Kubernetes篇】Ingress案例实战

Elsevier ---elseviewer--- preprint online publishing notice

2021-02-27image processing of MATLAB

Programming implementation: input any English month, and output its corresponding Chinese prompt after looking up the month table. Abbreviations can also be found.
![[leetcode] restore binary search tree](/img/92/14c4d670f318f93297040241a61c41.jpg)
[leetcode] restore binary search tree

flutter_swiper 轮播图 插件

Task02: basic use of database (MySQL)

今日睡眠质量记录80分

AI fanaticism | come to this conference and work together on the new tools of AI!

In May, the main growth ranking list (platform of station B) of the single flying melon data up was released
随机推荐
---Arrange numbers---
Dialog AlertDialog 、SimpleDialog、showModalBottomSheet、showToast Flutter 自定义 Dialog
Leetcode 1094 car pooling (Analog)
Byte Beijing 23K and pinduoduo Shanghai 28K, how should I choose?
逻辑漏洞 / 业务漏洞
How to change the theme of win11 touch keyboard? Win11 method of changing touch keyboard theme
[BSP video tutorial] BSP video tutorial issue 17: single chip microcomputer bootloader topic, startup, jump configuration and various usage of debugging and downloading (2022-06-10)
[Haas hands on] creative case of new video program launch we started the first phase together E01: Internet of things engineers started the remote control manipulator with you
Xpath注入
ACM tutorial - heap sorting
[matlab] image segmentation
Task03: building an offline material system
Programming implementation: input any English month, and output its corresponding Chinese prompt after looking up the month table. Abbreviations can also be found.
视频压缩数据集TVD
Leetcode 1116 print zero even odd (concurrent multithreading countdownlatch lock condition)
Treatment of small fish
面试官:介绍一下你简历中的项目,细讲一点,附项目实战
How to reinstall win11 drawing tool when it is missing
[music] playing city of the sky based on MATLAB [including Matlab source code 1874]
今日睡眠质量记录80分