Pārlūkot izejas kodu

Added main function

Yesoda Sanka 6 gadus atpakaļ
vecāks
revīzija
f02c6432e0
4 mainītis faili ar 26 papildinājumiem un 1 dzēšanām
  1. Binārs
      Main.class
  2. 5
    0
      Main.ctxt
  3. 20
    0
      Main.java
  4. 1
    1
      package.bluej

Binārs
Main.class Parādīt failu


+ 5
- 0
Main.ctxt Parādīt failu

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

+ 20
- 0
Main.java Parādīt failu

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

+ 1
- 1
package.bluej Parādīt failu

@@ -4,7 +4,7 @@ editor.fx.0.width=0
4 4
 editor.fx.0.x=0
5 5
 editor.fx.0.y=0
6 6
 objectbench.height=101
7
-objectbench.width=776
7
+objectbench.width=461
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.8007380073800738
10 10
 package.editor.height=427