Skip to content

Instantly share code, notes, and snippets.

@donchan922
Last active August 20, 2018 08:38
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/903e0fd69cea1e7b488377e8d8a0db92 to your computer and use it in GitHub Desktop.
Save donchan922/903e0fd69cea1e7b488377e8d8a0db92 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class ScannerExample {
public static void main (String[] args) {
// System.in -> キーボード入力を受け付けるための引数
Scanner scanner = new Scanner(System.in);
System.out.print("名前を入力してください:");
// キーボード入力を受け付ける
String name = scanner.next();
System.out.println("こんにちは、" + name + "さん");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment