文章标题
2016-09-18 23:01
295 查看
package com.bb;
public class Demo1 {
/**
* @param args
* Java的switch的运用
*/
public static void main(String[] args) {
int num=2;
switch(num){
case 1:
System.out.println(“111”);
break;
case 2:
System.out.println(“23”);
break;
case 5:
System.out.println(“344”);
break;
}
int i=22;
switch(i)
{ case 1:System.out.println(“you are the first!”);
case 2:System.out.println(“you are the second!”);
case 3:System.out.println(“you are the third!”); break;
default:System.out.println(“you are the last!”);
}
int a = 1;
switch (a) {
case 2:
System.out.println(“In case 2”);
break;
case 3:
System.out.println(“In case 3”);
break;
default:
System.out.println(“In default”);
break;
case 1:
System.out.println(“In case 1”);
break;
}
}
}
public class Demo1 {
/**
* @param args
* Java的switch的运用
*/
public static void main(String[] args) {
int num=2;
switch(num){
case 1:
System.out.println(“111”);
break;
case 2:
System.out.println(“23”);
break;
case 5:
System.out.println(“344”);
break;
}
int i=22;
switch(i)
{ case 1:System.out.println(“you are the first!”);
case 2:System.out.println(“you are the second!”);
case 3:System.out.println(“you are the third!”); break;
default:System.out.println(“you are the last!”);
}
int a = 1;
switch (a) {
case 2:
System.out.println(“In case 2”);
break;
case 3:
System.out.println(“In case 3”);
break;
default:
System.out.println(“In default”);
break;
case 1:
System.out.println(“In case 1”);
break;
}
}
}
相关文章推荐
- 有些事儿,工程师可能今生仅此一次
- 如何Dump当前Java应用的内存结构,并进行分析找到占用空间最大的Class
- Codeforces Round #372 (Div. 2)
- poj 2377 Bad Cowtractors
- 20145301 《信息安全系统设计基础》第1周学习总结
- PopupWindow实现弹窗,可以任意自定义布局
- strut2总结(1)
- jQuery笔记
- 调整文字在框内的位置
- 黑苹果El Captain 10.11.2 安装
- 快速排序--C#代码篇
- 分词及词云图绘制-R语言
- SDWebImage源代码阅读(四)
- POJ1195 Mobile phones
- HDU 2527 Safe Or Unsafe(哈夫曼编码)
- # 20145220《信息安全系统设计基础》第1周学习总结
- Angular2学习笔记——在子组件中拿到路由参数
- android animator
- 文章标题
- 解决三星android拍照时返回null问题