Answers for "how to declare variable value in java"

2

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
0

java variable

//this are the most common ones
int x = 5; 
String y = "hello";
System.out.println(x + y);
Posted by: Guest on April-21-2022

Code answers related to "how to declare variable value in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language