Skip to content

Instantly share code, notes, and snippets.

@donchan922
Last active August 20, 2018 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/b9d4a2fa1ca70fb444387f46d4b45f48 to your computer and use it in GitHub Desktop.
Save donchan922/b9d4a2fa1ca70fb444387f46d4b45f48 to your computer and use it in GitHub Desktop.
import java.io.*;
class BufferedReaderExample {
public static void main (String[] args) {
// System.in -> キーボード入力を受け付けるための引数
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("名前を入力してください:");
try {
// キーボード入力を受け付ける
String name = br.readLine();
System.out.println("こんにちは、" + name + "さん");
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment