public class Wertebereiche { public static void main(String[] args) { // Aufgabe: Größte/Kleinste byte,short,int,long-Zahl ausgeben: // NB: In den Java-Klassen Byte, Short, Integer, Long sind die // kleinsten/größten Werte bereits als Konstanten vordefiniert. byte b_min = Byte.MIN_VALUE; // -128 byte b_max = Byte.MAX_VALUE; // 127 System.out.println("Kleinstes Byte: " + b_min); System.out.println("Größtes Byte: " + b_max); short s_min = Short.MIN_VALUE; // -32768 short s_max = Short.MAX_VALUE; // 32767 System.out.println("Kleinstes Short: " + s_min); System.out.println("Größtes Short: " + s_max); int i_min = Integer.MIN_VALUE; // -2147483648 int i_max = Integer.MAX_VALUE; // 2147483647 System.out.println("Kleinstes Integer: " + i_min); System.out.println("Größtes Integer: " + i_max); long l_min = Long.MIN_VALUE; // -9223372036854775808 long l_max = Long.MAX_VALUE; // 9223372036854775807 System.out.println("Kleinstes Long: " + l_min); System.out.println("Größtes Long: " + l_max); System.out.println("Long.MAX_VALUE + 1: " + ++l_max); } }