Tuesday, November 22, 2016

Write a JAVA program to display default value of all primitive data types of JAVA

Aim: Write a JAVA program to display default value of all primitive data types of JAVA

Program:


class  DefaultValues
{
    static byte b;
    static short s;
    static int i;
    static long l;
    static float f;
    static double d;
    static char c;
    static boolean bl;
    public static void main(String[] args) 
    {
        System.out.println("Byte :"+b);
        System.out.println("Short :"+s);
        System.out.println("Int :"+i);
        System.out.println("Long :"+l);
        System.out.println("Float :"+f);
        System.out.println("Double :"+d);
        System.out.println("Char :"+c);
        System.out.println("Boolean :"+bl);
    }
}

Output:


Labels:

2 Comments:

At September 14, 2019 at 12:30 PM , Blogger DURGESH PRAJAPATI said...

Thanks to provide this answer

 
At November 13, 2019 at 9:13 PM , Blogger Unknown said...

Thanks it help me a lot in my beginning stages

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home