News

Monday, November 9, 2015

JAVA PROGRAM BASIC DATATYPE




import java.io.*;
class datatype
{
    public static void main(String args[])
    {
        System.out.println("...Implementation of data types...\n\n\n");
       
        int a=40000;
        char b='a';
        float c=3.142F;
        double d=34;
        long e=9999111999911L;
        byte f=3;
        boolean g=(a>d);
        short h=31666;
        String i="Welcome to Java Lab";
        System.out.println("...Character data type...\n c = "+b+"\n");
        System.out.println("...String data type...\n b = "+i+"\n");
        System.out.println("...Integer data type...\n d = "+a+"\n");
        System.out.println("...Short data type...\n k = "+h+"\n");
        System.out.println("...Long data type...\n z = "+e+"\n");
        System.out.println("...Float data type...\n s = "+c+"\n");
        System.out.println("...Double data type...\n v = "+d+"\n");
        System.out.println("...Byte data type...\n e = "+h+"\n");
        System.out.println("...Boolean data type...\n g = "+g+"\n");
    }
}

Reactions:

0 comments:

Post a Comment