본문 바로가기

프로그래머/JAVA

DAY07] CALL BY VALUE


import java.io.*;

public class Exam_05 {
 public static int getInt(String x) throws IOException {
  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  System.out.print(x + " = ");
  int s = Integer.parseInt(in.readLine());
  return s;
 }
 public static void main(String[] ar) throws IOException {
  int age = getInt("나이");
  System.out.println("age = " + age);
 }
}