Bits and pieces: A size-able challenge

Report a typo

Create a Java program that displays the size in bits for different primitive data types. Fill in the blanks in the code to complete the class and method declarations, and add the missing data type for the first print statement.

Fill in the gaps with the relevant elements
  DataTypeSizes {
    public   main(String[] args) {
        System.out.println(": " + (Byte.SIZE) + " bits");
        System.out.println("short: " + (Short.SIZE) + " bits");
        System.out.println("int: " + (Integer.SIZE) + " bits");
        System.out.println("long: " + (Long.SIZE) + " bits");
        System.out.println("float: " + (Float.SIZE) + " bits");
        System.out.println("double: " + (Double.SIZE) + " bits");
    }
}
finalmodulebyteintclassprivatevoidmainstaticpublic

Create a free account to access the full topic