瀏覽代碼

beer-song: update reference solution to package-private

Sam Warner 8 年之前
父節點
當前提交
7a2941dbf8
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      exercises/beer-song/.meta/src/reference/java/BeerSong.java

+ 4
- 4
exercises/beer-song/.meta/src/reference/java/BeerSong.java 查看文件

1
-public class BeerSong {
2
-    public String verse(int number) {
1
+class BeerSong {
2
+    String verse(int number) {
3
         switch (number) {
3
         switch (number) {
4
             case 0:
4
             case 0:
5
                 return "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n";
5
                 return "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n";
12
         }
12
         }
13
     }
13
     }
14
 
14
 
15
-    public String sing(int start, int stop) {
15
+    String sing(int start, int stop) {
16
         StringBuilder songOutput = new StringBuilder();
16
         StringBuilder songOutput = new StringBuilder();
17
 
17
 
18
         for (int i=start; i>=stop; i--) {
18
         for (int i=start; i>=stop; i--) {
22
         return songOutput.toString();
22
         return songOutput.toString();
23
     }
23
     }
24
 
24
 
25
-    public String singSong() {
25
+    String singSong() {
26
         return sing(99,0);
26
         return sing(99,0);
27
     }
27
     }
28
 }
28
 }