1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.io.*;
 
public class Exam_06 {
    public static void main(String[] ar) throws IOException{
        System.out.print("키보드 하나를 누르세요 =  ");
        //int x = System.in.read();
        char x = (char)System.in.read();
        System.out.println("x = " + x);
        System.in.read();
        System.in.read();
        System.out.print("숫자 하나 입력 = ");
        int y = System.in.read() - 48;
        System.out.println("y = " + y);
    }
}
 
cs


'공부 > JAVA_source' 카테고리의 다른 글

자바 Scanner 클래스 (입력)  (0) 2016.10.19
자바 입출력 (2)  (0) 2016.10.19
자바 예외처리 (throws IOException)  (0) 2016.10.19
자바 연산자 및 출력 형식  (0) 2016.10.19
자바 입출력  (0) 2016.10.19

+ Recent posts