Last active
August 20, 2018 08:37
-
-
Save donchan922/b9d4a2fa1ca70fb444387f46d4b45f48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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