본문 바로가기

JAVA/기초다지기

조건문(응용)

package org.opentutorials.javatutorials.condition;
 
public class LoginDemo {
    public static void main(String[] args) {
        String id = args[0];
        if(id.equals("egoing")){
            System.out.println("right");
        } else {
            System.out.println("wrong");
        }
    }
}

 

args[](입력값) -> Run configurations(이프로그램을 실행할때 설정을 바꿀 수 있음) -> Arguments(입력값) 

 

'JAVA > 기초다지기' 카테고리의 다른 글

조건문(switch)  (0) 2021.02.28
조건문(중첩)  (0) 2021.02.28
조건문(else)  (0) 2021.02.28
조건문 (if)  (0) 2021.02.28
Boolean과 Comparison Operator  (0) 2021.02.28