Help us understand the problem. What is going on with this article?

FizzBuzz on Java

More than 5 years have passed since last update.

投稿がゼロというのはさみしいのでなんとくなく.
Eclipseで30秒くらい.メソッドで分離している意味は特になし.

FizzBuzz.java
public class FizzBuzz {
    private enum MOD_TYPE {
        FIZZ,BUZZ,FIZZBUZZ,NONE;
    }

    public static void main(String[] arg) {
        for (int i = 1; i <= 10000; i++) {
            switch (checkFizzBuzz(i)) {
            case FIZZ:
                System.out.println("fizz");
                break;
            case BUZZ:
                System.out.println("buzz");
                break;
            case FIZZBUZZ:
                System.out.println("fizzbuzz");
                break;
            default:
                System.out.println(i);
            }
        }
    }

    private static MOD_TYPE checkFizzBuzz(int number) {
        if (number % 15 == 0) {
            return MOD_TYPE.FIZZBUZZ;
        } else if (number % 5 == 0) {
            return MOD_TYPE.BUZZ;
        } else if (number % 3 == 0) {
            return MOD_TYPE.FIZZ;
        }
        return MOD_TYPE.NONE;
    }
}
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away