Monday, 12 September 2016

JAVA BLOG_4

DATATYEPES

------------------------------------------------------------

Program:

 class DataTypeDemo
{
    public static void main(String args[])
    {
        int i=1;
        char c='j';
        float f=0.2f;
        double d=1.2;
        long l=1233444;
        short s=12;
        boolean b=true;

        System.out.println("i:"+i);
        System.out.println("c:"+c);
        System.out.println("f:"+f);
        System.out.println("d:"+d);
        System.out.println("l:"+l);
        System.out.println("s:"+s);
        System.out.println("b:"+b);

    }
}

------------------------------------------------------------------------------------------------------

Output:

 i:1
c:j
f:0.2
d:1.2
l:1233444
s:12
b:true

 

No comments:

Post a Comment