Bläddra i källkod

Alice and Bob

Nicholas Satinover 6 år sedan
förälder
incheckning
16d8543ba4
4 ändrade filer med 40 tillägg och 19 borttagningar
  1. Binär
      Main.class
  2. 7
    0
      Main.ctxt
  3. 17
    3
      Main.java
  4. 16
    16
      package.bluej

Binär
Main.class Visa fil


+ 7
- 0
Main.ctxt Visa fil

@@ -0,0 +1,7 @@
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
+comment1.text=\n\ No\ object\ instance\ is\ to\ be\ created\ to\ run\ static\ main\ method\n\ Run\ test\ from\ 'Main'\ class\ 'main'\ method\ -\ right\ click\ 'Main'\ class,\ select\ 'main'\n
7
+numComments=2

+ 17
- 3
Main.java Visa fil

@@ -1,9 +1,23 @@
1
+import java.util.Scanner;
2
+
1 3
 /**
2 4
  * Created by iyasuwatts on 10/17/17.
3 5
  */
4 6
 public class Main {
7
+        /**
8
+         * No object instance is to be created to run static main method
9
+         * Run test from 'Main' class 'main' method - right click 'Main' class, select 'main'
10
+         */
11
+        public static void main(String[] args ){
12
+            Scanner keyboard = new Scanner(System.in);
13
+            
14
+            System.out.println("Please enter your name.");
15
+            String name = keyboard.next();
16
+            
17
+            if(name.equalsIgnoreCase("Alice") || name.equalsIgnoreCase("Bob"))
18
+            {
19
+                System.out.println("Hello " + name);
20
+            }
21
+        }
5 22
 
6
-    public static void main(String[] args ){
7
-
8
-    }
9 23
 }

+ 16
- 16
package.bluej Visa fil

@@ -1,18 +1,18 @@
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
6
-objectbench.height=101
7
-objectbench.width=776
8
-package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
11
-package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
14
-package.frame.height=600
15
-package.frame.width=800
2
+editor.fx.0.height=709
3
+editor.fx.0.width=1280
4
+editor.fx.0.x=-140
5
+editor.fx.0.y=-889
6
+objectbench.height=164
7
+objectbench.width=1021
8
+package.divider.horizontal=0.5410526315789473
9
+package.divider.vertical=0.8288288288288288
10
+package.editor.height=821
11
+package.editor.width=1794
12
+package.editor.x=-306
13
+package.editor.y=-1057
14
+package.frame.height=1057
15
+package.frame.width=1920
16 16
 package.numDependencies=0
17 17
 package.numTargets=1
18 18
 package.showExtends=true
@@ -28,5 +28,5 @@ target1.name=Main
28 28
 target1.showInterface=false
29 29
 target1.type=ClassTarget
30 30
 target1.width=80
31
-target1.x=70
32
-target1.y=10
31
+target1.x=100
32
+target1.y=100