1234567891011121314151617181920212223242526272829 |
-
- /**
- * Write a description of class FizzBuzz here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzz
- {
- int number;
-
- public String FizzBuzz(int number)
- {
- if(number % 3 ==0 && number % 5 == 0){
- return "FizzBuzz";
- }
-
- if(number % 3 == 0){
- return "Fizz";
- }
-
- if(number % 5 == 0) {
- return "Buzz";
- }
- return null;
- }
-
- }
|