浏览代码

Said hi to Alice and Bob

Kate Moore 6 年前
父节点
当前提交
773a9263b8
共有 4 个文件被更改,包括 33 次插入7 次删除
  1. 二进制
      Main.class
  2. 8
    0
      Main.ctxt
  3. 19
    1
      Main.java
  4. 6
    6
      package.bluej

二进制
Main.class 查看文件


+ 8
- 0
Main.ctxt 查看文件

1
+#BlueJ class context
2
+comment0.target=Main
3
+comment0.text=\n\ Created\ by\ iyasuwatts\ on\ 10/17/17.\n
4
+comment1.params=args
5
+comment1.target=void\ main(java.lang.String[])
6
+comment2.params=
7
+comment2.target=void\ getName()
8
+numComments=3

+ 19
- 1
Main.java 查看文件

1
+import java.util.*;
2
+
1
 /**
3
 /**
2
  * Created by iyasuwatts on 10/17/17.
4
  * Created by iyasuwatts on 10/17/17.
3
  */
5
  */
4
 public class Main {
6
 public class Main {
5
 
7
 
6
-    public static void main(String[] args ){
7
 
8
 
9
+    public static void main(String[] args ){
10
+        
11
+        
8
     }
12
     }
13
+    
14
+    public void getName() {
15
+        Scanner word = new Scanner(System.in);
16
+        System.out.print("What is your name?");
17
+        String name = word.nextLine();
18
+        
19
+            if(name.equals("Alice")) {
20
+            System.out.println("Hi Alice");
21
+        } else if (name.equals("Bob")) {
22
+            System.out.println("Hi Bob");
23
+        } else {
24
+            System.out.println("Hi YOU");
25
+        }
26
+        }
9
 }
27
 }

+ 6
- 6
package.bluej 查看文件

1
 #BlueJ package file
1
 #BlueJ package file
2
-editor.fx.0.height=0
3
-editor.fx.0.width=0
4
-editor.fx.0.x=0
5
-editor.fx.0.y=0
2
+editor.fx.0.height=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=479
5
+editor.fx.0.y=23
6
 objectbench.height=101
6
 objectbench.height=101
7
 objectbench.width=776
7
 objectbench.width=776
8
 package.divider.horizontal=0.6
8
 package.divider.horizontal=0.6
9
 package.divider.vertical=0.8007380073800738
9
 package.divider.vertical=0.8007380073800738
10
 package.editor.height=427
10
 package.editor.height=427
11
 package.editor.width=674
11
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
12
+package.editor.x=0
13
+package.editor.y=124
14
 package.frame.height=600
14
 package.frame.height=600
15
 package.frame.width=800
15
 package.frame.width=800
16
 package.numDependencies=0
16
 package.numDependencies=0