Skip to content

Commit 5285238

Browse files
author
Aleksandr Pronichev
committed
add Cli.java
1 parent 073a45e commit 5285238

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package hexlet.code;
2+
3+
import java.util.Scanner;
4+
5+
public class Cli {
6+
public static void greeting() {
7+
Scanner scanner = new Scanner(System.in);
8+
System.out.print("May I have your name? ");
9+
String userName = scanner.next();
10+
System.out.println("Hello, " + userName + "!");
11+
scanner.close();
12+
}
13+
}

0 commit comments

Comments
 (0)