Просмотр исходного кода

Merge pull request #564 from exercism/542-raindrops-starter

raindrops: standardize starter implementation
FridaTveit 9 лет назад
Родитель
Сommit
e09c2e01bb

+ 4
- 3
exercises/raindrops/src/example/java/RaindropConverter.java Просмотреть файл

@@ -1,6 +1,6 @@
1
-public class RaindropConverter {
1
+class RaindropConverter {
2 2
 
3
-    public String convert(int number) {
3
+    String convert(int number) {
4 4
         String result = "";
5 5
 
6 6
         if (number % 3 == 0) {
@@ -15,10 +15,11 @@ public class RaindropConverter {
15 15
             result += "Plong";
16 16
         }
17 17
 
18
-        if (result == null || result.isEmpty()) {
18
+        if (result.isEmpty()) {
19 19
             result = Integer.toString(number);
20 20
         }
21 21
 
22 22
         return result;
23 23
     }
24
+
24 25
 }

+ 0
- 0
exercises/raindrops/src/main/java/.keep Просмотреть файл


+ 7
- 0
exercises/raindrops/src/main/java/RaindropConverter.java Просмотреть файл

@@ -0,0 +1,7 @@
1
+class RaindropConverter {
2
+
3
+    String convert(int number) {
4
+        throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
5
+    }
6
+
7
+}