switch语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上?
来源:互联网 发布:redis与mysql的区别 编辑:程序博客网 时间:2024/06/05 15:43
在面试宝典中是这样解释的“
在switch(expr1)中,expr1只能是一个整数表达式或者枚举常量,整数表达式可以是int基本类型或Integer包装类型,由于,byte,short,char都可以隐含转换为int,所以,这些类型以及这些类型的包装类型也是可以的。显然,long和String类型都不符合switch的语法规定,并且不能被隐式转换成int类型,所以,它们不能作用于swtich语句中”
需要注意的是在JDK1.7之后可以作用在 String 上
阅读全文
1 0
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch 语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上?
- 面试题:switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- switch语句能否作用在byte上,能否作用在long上,能否作用在String上
- switch语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上?
- switch语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上?
- switch能否作用在char上,能否作用在byte上,能否作用在string上?
- switch能否作用在byte、long、String上?
- Android-ViewFlipper的滑动与子视图中item点击的冲突解决
- 随机排序算法
- 从零开始学Python学习笔记---之--pandas序列部分
- Linux中常用操作命令
- myeclipse8.6注册代码
- switch语句能否作用在 byte 上,能否作用在 long 上,能否作用在 String 上?
- 内存分配之堆和栈的区别
- SpringBoot开荒之路
- 网络安全靠法制,网络信息内容管理又增两细则
- 九九乘法表、java、MySQL 编程题
- 四五、使用form表单提交,post请求提交参数,跳转页面。
- caffe的python接口学习(8):caffemodel中的参数及特征的抽取
- html语义化
- swift之属性观察 (willSet和didSet)