IfEx01.java-조건문 - 단일 If문

CODEDRAGON Development/Java

반응형

조건문 - 단일 If문

   

   

소스코드

   

  1. public class IfEx01 {
  2.    
  3.         public static void main(String[] args) {               
  4.                  
  5.                 int n =10;
  6. //              int n =4;
  7.                  
  8.                 if( n > 5){
  9.                         System.out.println("n 5보다 크다");
  10.                 }
  11.                  
  12.                 System.out.println("프로그램 종료");
  13.         }
  14. }


 

   

출력결과

n=4인 경우

   

   

n=10인 경우

   

반응형

'Development > Java' 카테고리의 다른 글

SwitchEx01.java-switch문에서 정수 비교하기  (0) 2014.12.08
IfEx02.java-단일 if  (0) 2014.12.07
if문, if문 형식, if~else문, if vs if~else  (0) 2014.12.05
제어문 종류  (0) 2014.12.04
제어문  (0) 2014.12.03