public class Extremwerte { static final int TEST = 100; // Extremwerte.TEST public static void main(String[] args) { // Werte aus Tabelle byte b = Byte.MAX_VALUE; // Konstante aus Klasse Byte short s = Short.MAX_VALUE; int i = Integer.MAX_VALUE; long l = Long.MAX_VALUE; // Alternativ: Bits setzen // byte b = 0xef; // Alle bits bis auf das erste sind gesetzt. System.out.println("Byte max:" + b); System.out.println("Short max:" + s); System.out.println("Integer max:" + i); System.out.println("Long max:" + l); b = Byte.MIN_VALUE; s = Short.MIN_VALUE; i = Integer.MIN_VALUE; l = Long.MIN_VALUE; System.out.println("Byte min:" + b); System.out.println("Short min:" + s); System.out.println("Integer min:" + i); System.out.println("Long min:" + l); l = Long.MAX_VALUE; l++; System.out.println("Größte long-Zahl + 1 = " + l); l = Long.MIN_VALUE; l--; System.out.println("Kleinste long-Zahl - 1 = " + l); } }