Imagine a Java program that prints the maximum values of different types of integer data that stores binary information. It displays the maximum value for byte, short, int, and long. Your task is to fill the blanks in the code so it works correctly, considering the maximium storage capacity for each data type.
Primitive data types and their sizes
Displaying maximum values of various integer types
Report a typo
Fill in the gaps with the relevant elements
public class Main {
public static void main(String[] args) {
b = 127;
s = 32767;
i = 2147483647;
l = 9223372036854775807L;
System.out.println("Max value for byte: " + b);
System.out.println("Max value for short: " + s);
System.out.println("Max value for int: " + i);
System.out.println("Max value for long: " + l);
}
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
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.