public class AuthApp2 {
public static void main(String[] args) {
System.out.println(args[0]);
String id = "ujin";
String inputId = args[0]; // 1번째 입력값 ujin
String pass = "3153";
String inputPass = args[1]; // 2번째 입력값 3150
System.out.println("Hi.");
if(inputId.equals(id) && inputPass.equals(pass) ) { // equals
System.out.println("Master!");
}
else {
System.out.println("Who are u?");
}
}
} //ujin
// Hi.
//Who are u?
&& 는 and 연산자
|| 는 or 연산자
! 는 not 연산자
원시데이터 타입은 == , 그 이외는 equals 사용
'시작 전' 카테고리의 다른 글
제어문 - 배열과 반복문 (0) | 2022.07.08 |
---|---|
반복문 - while 과 for (0) | 2022.07.07 |
제어문 - 조건문 (0) | 2022.07.07 |
App 만들기 - 기본기능 (0) | 2022.07.01 |
arguments & parameter (0) | 2022.06.30 |