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.
Primitive data types and their sizes
Bits and pieces: A size-able challenge
Report a typo
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");
}
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.