Amy Gill před 6 roky
rodič
revize
3834bdb11d

+ 5
- 4
src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java Zobrazit soubor

11
      */
11
      */
12
     public Boolean isGreaterThan(int x, int y) {
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
      * @return true if `x` is less than `y`
20
      * @return true if `x` is less than `y`
21
      */
21
      */
22
     public Boolean isLessThan(int x, int y) {
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
      * @return true if `x` is greater than or equal to `y`
29
      * @return true if `x` is greater than or equal to `y`
30
      */
30
      */
31
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
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
      * @return true if `x` is less than or equal to `y`
38
      * @return true if `x` is less than or equal to `y`
39
      */
39
      */
40
     public Boolean isLessThanOrEqualTo(int x, int y) {
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 Zobrazit soubor

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

binární
target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class Zobrazit soubor


binární
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class Zobrazit soubor