DevJourney

Java/Basics/var_declaration.java

package Java.Basics;

public class var_declaration {
    
    public static void main(String[] args){
        
        int x=123;
        System.out.println("My short number is: "+x);

        long y=1231231414215231241L;
        System.out.println("My long number is: "+y);

        float z=3.14f;
        System.out.println("My float number is: "+z);

        double a=3.14;
        System.out.println("My double number is: "+a);

        boolean b=true;
        System.out.println("My boolean is: "+b);
        
        char symbol='@';
        System.out.println("My char is: "+symbol);

        String name="Bro";
        System.out.println("My string is: "+name);

    }
}
 
View on GitHub