Browse Source

finished commit

John Kim 6 years ago
parent
commit
aa1f361749
3 changed files with 12 additions and 0 deletions
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 7
    0
      Main.java

BIN
Main.class View File


+ 5
- 0
Main.ctxt View File

1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+numComments=2

+ 7
- 0
Main.java View File

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