12345678910111213141516171819202122232425262728293031 |
-
- /**
- * Write a description of class FizzBuzz here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzz
- {
-
- public FizzBuzz()
- {
- }
-
- public String of(int value) {
- if (value % 3 == 0 && value % 5 == 0) {
- return "fizzbuzz";
- }
- if (value % 3 == 0) {
- return "fizz";
- }
- if (value % 5 == 0) {
- return "buzz";
- }
-
- return Integer.toString(value);
- }
-
-
- }
|