FizzBuzz in Java

I've become able to write a little code, so I wrote FizzBuzz for the time being.

FizzBuzz.java


public class FizzBuzz{
    public static void main(String[] args){
        for(int i = 1; i < 101; i ++){
            String display;//Variables to display
            if(i % 3 == 0 && i % 5 == 0){
                display = "FizzBuzz";
            }else if(i % 3 == 0){
                display = "Fizz";
            }else if(i % 5 == 0){
                display = "Buzz";
            }else{
                //Convert int type variable "i" to String type
                display = String.valueOf(i);
            }
            System.out.println(display);//display
        }
    }
}

Recommended Posts

FizzBuzz in Java
Object-oriented FizzBuzz (Java)
Changes in Java 11
Rock-paper-scissors in Java
[java] sort in list
Read JSON in Java
Make Blackjack in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
Combine arrays in Java
"Hello World" in Java
Callable Interface in Java
Comments in Java source
Azure functions in java
Format XML in Java
Simple htmlspecialchars in Java
Hello World in Java
Use OpenCV in Java
webApi memorandum in java
Type determination in Java
Ping commands in Java
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
POST JSON in Java
Date manipulation in Java 8
What's new in Java 8
Use PreparedStatement in Java
What's new in Java 9,10,11
Parallel execution in Java
Initializing HashMap in Java
Try using RocksDB in Java
Avoid Yubaba's error in Java
Get EXIF information in Java
Save Java PDF in Excel
Edit ini in Java: ini4j
Java history in this world
Try calling JavaScript in Java
Try functional type in Java! ①
I made roulette in Java.
Create hyperlinks in Java PowerPoint
Implement two-step verification in Java
Refactoring: Make Blackjack in Java
Topic Analysis (LDA) in Java
NEologd preprocessing in Java neologdn-java
Change java encoding in windows
Java Stream API in 5 minutes
Cannot find javax.annotation.Generated in Java 11
Read standard input in Java
Implement Basic authentication in Java
Find a subset in Java
[Java] Get KClass in Java [Kotlin]
Create Azure Functions in Java
Import Excel data in Java
Implement math combinations in Java
JavaFX environment construction in Java 13
Insert footer in Java Powerpoint
Java
Enum Strategy pattern in Java
2 Implement simple parsing in Java