#멋쟁이사자처럼 #부트캠프 #백엔드 #JAVA

Gemini: Primitive Types in Java

Java has 8 primitive data types:

Practice: Print from 0 to 100

public class Practice01 {
    public static void main(String[] args) {
        int value = 0;

        while (value <= 100) {
            System.out.println(value);
            value++;
        }
    }
}

Practice: If Statements without Curly Braces

public class Practice02 {
    public static void main(String[] args) {
        int value = 18;

        if (value % 3 == 0)
            System.out.println("18 mod 3 is 0");

        System.out.println("--------------");

        if (value % 3 == 0) {
            System.out.println("18 mod 3 is 0");
            System.out.println("18 mod 3 is 0");
        }
    }
}

&& Operator