Ahmad Rusdi hace 6 años
padre
commit
88c655e141
Se han modificado 2 ficheros con 11 adiciones y 4 borrados
  1. BIN
      Main.class
  2. 11
    4
      Main.java

BIN
Main.class Ver fichero


+ 11
- 4
Main.java Ver fichero

@@ -1,9 +1,16 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
-public class Main {
4
+import java.util.Scanner;
5 5
 
6
-    public static void main(String[] args){
7
-        
8
-    }
6
+public class Main { 
7
+  public static void main(String[] args){
8
+    System.out.println("What is your name?: ");
9
+    Scanner scan = new Scanner(System.in);
10
+    String name = scan.nextLine();
11
+    String output = name.equals("Alice") || name.equals("Bob")
12
+      ? "Hello " + name
13
+      : "Stranger danger!";
14
+    System.out.println(output);
15
+  }
9 16
 }