Nicholas Maidanos 6 gadus atpakaļ
vecāks
revīzija
5eee9eae5d
2 mainītis faili ar 9 papildinājumiem un 8 dzēšanām
  1. 4
    3
      StringUtilities.java
  2. 5
    5
      package.bluej

+ 4
- 3
StringUtilities.java Parādīt failu

@@ -1,4 +1,5 @@
1 1
 
2
+import java.lang.StringBuilder;
2 3
 
3 4
 /**
4 5
  * Created by dan on 6/14/17.
@@ -87,11 +88,11 @@ public class StringUtilities {
87 88
      */
88 89
     public String reverse(String stringToReverse){
89 90
         char[] chars = stringToReverse.toCharArray();
90
-        String newString = "";
91
+        StringBuilder str = new StringBuilder();
91 92
         for(int i = chars.length - 1; i >= 0 ; i--){
92
-            newString = newString + Character.toString(chars[i]);
93
+            str.append(Character.toString(chars[i]));
93 94
         }
94
-        return newString;
95
+        return str.toString();
95 96
     }
96 97
 
97 98
     /**

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

@@ -8,10 +8,10 @@ dependency2.type=UsesDependency
8 8
 dependency3.from=PredicateUtilitiesTest
9 9
 dependency3.to=PredicateUtilities
10 10
 dependency3.type=UsesDependency
11
-editor.fx.0.height=0
12
-editor.fx.0.width=0
13
-editor.fx.0.x=0
14
-editor.fx.0.y=0
11
+editor.fx.0.height=684
12
+editor.fx.0.width=800
13
+editor.fx.0.x=993
14
+editor.fx.0.y=186
15 15
 objectbench.height=145
16 16
 objectbench.width=776
17 17
 package.divider.horizontal=0.6
@@ -19,7 +19,7 @@ package.divider.vertical=0.7195571955719557
19 19
 package.editor.height=383
20 20
 package.editor.width=674
21 21
 package.editor.x=284
22
-package.editor.y=51
22
+package.editor.y=331
23 23
 package.frame.height=600
24 24
 package.frame.width=800
25 25
 package.numDependencies=3