FizzBuzz.java 461B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Write a description of class FizzBuzz here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class FizzBuzz
  8. {
  9. public Integer input;
  10. public FizzBuzz(Integer input)
  11. {
  12. this.input = input;
  13. }
  14. public boolean getFizzBuzz(){
  15. return (input%15 == 0);
  16. }
  17. public boolean getFizz(){
  18. return (input%3 == 0);
  19. }
  20. public boolean getBuzz(){
  21. return (input%5 == 0);
  22. }
  23. }