Explorar el Código

beer-song: update reference solution to package-private

Sam Warner hace 8 años
padre
commit
7a2941dbf8
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4
    4
      exercises/beer-song/.meta/src/reference/java/BeerSong.java

+ 4
- 4
exercises/beer-song/.meta/src/reference/java/BeerSong.java Ver fichero

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
 }