We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffbb8f2 commit cb0c923Copy full SHA for cb0c923
app/Makefile
@@ -0,0 +1,2 @@
1
+run-dist:
2
+ ./build/install/app/bin/app
app/src/main/java/hexlet/code/App.java
@@ -2,6 +2,6 @@
3
public class App {
4
public static void main(String[] args) {
5
- System.out.println("Welcome to the Brain Games!");
+ Cli.sayHello();
6
}
7
app/src/main/java/hexlet/code/Cli.java
@@ -0,0 +1,17 @@
+package hexlet.code;
+
+import java.util.Scanner;
+public class Cli {
+ public static void sayHello() {
+ Scanner scanner = new Scanner(System.in);
8
9
+ System.out.println("Welcome to the Brain Games!");
10
+ System.out.print("May I have your name? ");
11
+ String name = scanner.nextLine();
12
13
+ System.out.println("Hello, " + name + "!");
14
15
+ scanner.close();
16
+ }
17
+}
0 commit comments