Answers for "declare variable using var in java"

1

variables in java

class Variables {
    public static void main(String[] args) {
        String msg = "Hello World"; // Strings
        int number = 10; // Integers
        float decimal = 7.369f; // Make sure to end the decimal with an f.
        char letter = 'A'; // Characters
        boolean result = true; // Booleans
    }
}
Posted by: Guest on September-28-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language