Tommy Rogers 6 lat temu
rodzic
commit
877fc31ab6
4 zmienionych plików z 40 dodań i 9 usunięć
  1. BIN
      Main.class
  2. 7
    0
      Main.ctxt
  3. 27
    3
      Main.java
  4. 6
    6
      package.bluej

BIN
Main.class Wyświetl plik


+ 7
- 0
Main.ctxt Wyświetl plik

@@ -0,0 +1,7 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=name
4
+comment1.target=Main(java.lang.String)
5
+comment2.params=args
6
+comment2.target=void\ main(java.lang.String[])
7
+numComments=3

+ 27
- 3
Main.java Wyświetl plik

@@ -1,9 +1,33 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+import java.util.Scanner;
4 5
 public class Main {
5
-
6
+    public String test;
7
+    
8
+  
9
+    
10
+    public Main(String name){
11
+        test = name;
12
+    }
6 13
     public static void main(String[] args ){
7
-
14
+       Scanner scan = new Scanner(System.in);
15
+       System.out.println("Enter your name");
16
+       String name = scan.nextLine();
17
+       if(name.equals("Alice")){
18
+           System.out.println("Hello Alice");
19
+        }
20
+        else if(name.equals("Bob")){
21
+        System.out.println("Hello Bob");
22
+        }
23
+        
24
+       else 
25
+       System.out.println("You are not worth my time");
26
+       
27
+       
8 28
     }
9
-}
29
+   
30
+    
31
+    
32
+    }
33
+

+ 6
- 6
package.bluej Wyświetl plik

@@ -1,16 +1,16 @@
1 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=128
5
+editor.fx.0.y=25
6 6
 objectbench.height=101
7 7
 objectbench.width=776
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.8007380073800738
10 10
 package.editor.height=427
11 11
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
12
+package.editor.x=111
13
+package.editor.y=69
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0