Amy Gill пре 6 година
родитељ
комит
3834bdb11d

+ 5
- 4
src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java Прегледај датотеку

@@ -11,7 +11,7 @@ public class PredicateUtilities {
11 11
      */
12 12
     public Boolean isGreaterThan(int x, int y) {
13 13
 
14
-        return x > y ? true:false;
14
+        return x > y;
15 15
     }
16 16
 
17 17
     /**
@@ -20,7 +20,7 @@ public class PredicateUtilities {
20 20
      * @return true if `x` is less than `y`
21 21
      */
22 22
     public Boolean isLessThan(int x, int y) {
23
-        return x < y ? true:false;
23
+        return x < y;
24 24
     }
25 25
 
26 26
     /**
@@ -29,7 +29,7 @@ public class PredicateUtilities {
29 29
      * @return true if `x` is greater than or equal to `y`
30 30
      */
31 31
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
32
-        return x>=y ? true:false;
32
+        return x>=y;
33 33
     }
34 34
 
35 35
     /**
@@ -38,6 +38,7 @@ public class PredicateUtilities {
38 38
      * @return true if `x` is less than or equal to `y`
39 39
      */
40 40
     public Boolean isLessThanOrEqualTo(int x, int y) {
41
-        return x<=y? true:false;
41
+
42
+        return x<=y;
42 43
     }
43 44
 }

+ 3
- 3
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java Прегледај датотеку

@@ -60,15 +60,15 @@ public class StringUtilities {
60 60
      * @return the middle character of `inputValue`
61 61
      */
62 62
     public static Character getMiddleCharacter(String inputValue){
63
-        int length;
63
+
64 64
         int position;
65 65
         if (inputValue.length() % 2 ==0) {
66 66
             position = inputValue.length()/2-1;
67
-            length = 2;
67
+
68 68
 
69 69
         } else {
70 70
             position = inputValue.length()/2;
71
-            length = 1;
71
+
72 72
         }
73 73
 
74 74
         return inputValue.charAt(position);

BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class Прегледај датотеку


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class Прегледај датотеку