일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Random
- 로또
- 전자정부
- 이클립스
- 다운캐스팅
- jquery
- Validations
- 상속
- angular2
- 상속예제
- 야구게임
- Full text
- 추상클래스
- 전체텍스트
- 전체
- 스프링
- 단축키
- 자바
- 다형성
- 25가지 효율적인 sql작성법
- 자바 야구게임
- Login with OAuth Authentication
- full text indexing
- 형변환
- 페이징
- while
- 가변인자
- 업캐스팅
- IBatis procedure
Archives
- Today
- Total
nalaolla
Switch~Case~Break 본문
728x90
반응형
- package test.com;
- public class Test06SwitchCaseBreak {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println("switch ~ case ~ default ~ break;");
- // 정수비교
- int x = 100;
- switch (x) {
- case 100 :
- System.out.println("A++");
- boolean bool = false;
- if(bool = x%2 == 0) {
- System.out.println("짝수");
- }
- System.out.println(bool);
- break; //if문의 블럭을 제외한 가장 가까운 블럭의 끝을 빠져나가라.
- case 90 :
- System.out.println("A");
- break;
- case 80 :
- System.out.println("B");
- break;
- default :
- System.out.println("Other");
- }
- }
- }
728x90
반응형
'JAVA > 3. Control' 카테고리의 다른 글
switch~case~break 성적관리 예제 (0) | 2015.12.20 |
---|---|
Switch~Case~Break 예제2 (0) | 2015.12.20 |
자바는 블럭단위 처리다. (0) | 2015.12.20 |
if~else GAME2 (0) | 2015.12.20 |
if~else game (0) | 2015.12.20 |