Procházet zdrojové kódy

Merge pull request #1016 from sjwarner-bp/bob-improve-ref

bob: improve reference solution
FridaTveit před 8 roky
rodič
revize
e3cf7e3d42
No account linked to committer's email
1 změnil soubory, kde provedl 8 přidání a 5 odebrání
  1. 8
    5
      exercises/bob/.meta/src/reference/java/Bob.java

+ 8
- 5
exercises/bob/.meta/src/reference/java/Bob.java Zobrazit soubor

@@ -1,15 +1,18 @@
1 1
 /**
2 2
  * Bob is a lackadasical teenager.
3 3
  */
4
-public class Bob {
5
-    public String hey(String input) {
4
+class Bob {
5
+    String hey(String input) {
6 6
         input = normalize(input);
7
-        if (isSilence(input))
7
+        if (isSilence(input)) {
8 8
             return "Fine. Be that way!";
9
-        if (isShout(input))
9
+        }
10
+        if (isShout(input)) {
10 11
             return "Whoa, chill out!";
11
-        if (isQuestion(input))
12
+        }
13
+        if (isQuestion(input)) {
12 14
             return "Sure.";
15
+        }
13 16
         return "Whatever.";
14 17
     }
15 18