본문 바로가기
Begin 2018

Scanner 작성법

by ZEROMI 2018. 4. 9.
728x90

char ch = new Scanner(System.in).next().charAt(0); // 한글자 꺼낼 때 한 줄만 선언하면 됨


String newpass = new Scanner(System.in).next(); // 기본 Scanner


Scanner sc = new Scanner(System.in); // 스캐너 여러개 사용해야 할 때 먼저 선언. 넥스트 안씀

String newpass = sc.next(); // 이후에 사용할 땐로 간단하게 사용

728x90