프로그래밍/JAVA

[JAVA] Scanner를 이용하여 char 입력받기

노력의천재 2019. 6. 26. 17:16
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
        char i=scanner.next().charAt(0);
        char j=scanner.next().charAt(0);
        System.out.println(j+" "+i);
        scanner.close();
    }
}
​