Java Program To Find Size Of Data Types

Write Java program to find the size of various data types

// WAP to demonstrate size of various data types


public class SizeDataType
{
    public static void main(String []args) 
    {
    
       System.out.println("Size of Byte is :-->"+Byte.SIZE);
       System.out.println("Size of Character is :-->"+Character.SIZE);
       System.out.println("Size of short is :-->"+Short.SIZE);
       System.out.println("Size of Integer is :-->"+Integer.SIZE);
       System.out.println("Size of Long is :-->"+Long.SIZE);
       System.out.println("Size of Float is :-->"+Float.SIZE);
       System.out.println("Size of Double is :-->"+Double.SIZE);

    }
}

Output:


<< Previous | Next >>


Leave a Reply

Your email address will not be published.