Kaynağa Gözat

acronym: standardize starter implementation

Stuart Kent 9 yıl önce
ebeveyn
işleme
1145344a6f

+ 6
- 4
exercises/acronym/src/example/java/Acronym.java Dosyayı Görüntüle

1
 import java.util.regex.Matcher;
1
 import java.util.regex.Matcher;
2
 import java.util.regex.Pattern;
2
 import java.util.regex.Pattern;
3
 
3
 
4
-public class Acronym {
4
+final class Acronym {
5
+
5
     private final String acronym;
6
     private final String acronym;
6
 
7
 
7
-    public Acronym(String phrase) {
8
+    Acronym(String phrase) {
8
         acronym = generateAcronym(phrase);
9
         acronym = generateAcronym(phrase);
9
     }
10
     }
10
 
11
 
11
-    public String get() {
12
+    String get() {
12
         return acronym;
13
         return acronym;
13
     }
14
     }
14
 
15
 
21
         }
22
         }
22
         return b.toString().toUpperCase();
23
         return b.toString().toUpperCase();
23
     }
24
     }
24
-}
25
+
26
+}

+ 0
- 0
exercises/acronym/src/main/java/.keep Dosyayı Görüntüle


+ 11
- 0
exercises/acronym/src/main/java/Acronym.java Dosyayı Görüntüle

1
+final class Acronym {
2
+
3
+    Acronym(String phrase) {
4
+        throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
5
+    }
6
+
7
+    String get() {
8
+        throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
9
+    }
10
+
11
+}