잠토의 잠망경

실습 1 본문

공부/Java

실습 1

잠수함토끼 2009. 3. 11. 09:41
import java.io.*;

public class ex1 {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		// TODO Auto-generated method stub
		try {
			BufferedReader in = new BufferedReader(new InputStreamReader(
					System.in));
			// stdin을 통해서 입력을 받는다는 얘기

			int inVal = 0;// 숫자 저장문
			System.out.print("정수입력:");// 입력출력문
			inVal = Integer.parseInt(in.readLine()); // 문자를 숫자로 변환
			System.out.println(inVal);// stdout을 통해 숫자를 출력
		}

		catch (Exception e) {
			System.out.println("에러났당");
		}

		finally {
			System.out.println("에헤라디야");
		}

	}

}

Comments