일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
31 |
Tags
- 상속예제
- 업캐스팅
- jquery
- IBatis procedure
- 야구게임
- 이클립스
- Validations
- angular2
- 상속
- while
- 로또
- 다형성
- Random
- 스프링
- 다운캐스팅
- 가변인자
- 25가지 효율적인 sql작성법
- 추상클래스
- 단축키
- 전체텍스트
- 자바 야구게임
- Login with OAuth Authentication
- Full text
- 자바
- 전체
- 형변환
- 전자정부
- 페이징
- full text indexing
Archives
- Today
- Total
nalaolla
if~else 본문
728x90
반응형
- package test.com;
- public class Test01ifelse {
- public static void main(String[] args) {
- // 제어문 : 분기문, 반복문
- // 분기문 : if, if~else, if~else if~else if..., if~else if~else
- // switch~case 비교대상: ~default:
- // 반복문 : for, while, do~while
- int su = 2;
- if (su == 0) {
- System.out.println("AAA");
- } else if (su == 1) {
- System.out.println("BBB");
- } else if (su == 2) {
- System.out.println("CCC");
- }
- else {
- System.out.println("Other");
- }
- if ('A' == 65) {
- System.out.println("A");
- if (3 + 5 == 8) {
- System.out.println("888");
- if (true) {
- System.out.println(true);
- }
- } else {
- System.out.println("000");
- }
- }
- System.out.println("end...");
- }
- }
728x90
반응형
'JAVA > 3. Control' 카테고리의 다른 글
if~else 자판기2 (0) | 2015.12.20 |
---|---|
if~else 자판기 (0) | 2015.12.20 |
while과 switch문 사용 연락처입력 (0) | 2015.12.20 |
if~else 성적처리 프로그램 (0) | 2015.12.20 |
if~else 수당계산 (0) | 2015.12.20 |