You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BoundaryNums.java 835B

12345678910111213141516171819202122232425262728293031323334
  1. //Over-boundary base values cause compile-time errors
  2. public class BoundaryNums {
  3. public static void main(String[] args) {
  4. byte minByte = -129;
  5. byte maxByte = 128;
  6. byte minByteHex = -0x81;
  7. byte maxByteHex = 0x80;
  8. short minShort = -32769;
  9. short maxShort = 32768;
  10. short minShortHex = -0x8001;
  11. short maxShortHex = 0x8000;
  12. char maxChar = 65536;
  13. char maxCharHex = 0x10000;
  14. char maxCharChar = '\u10000';
  15. int minInt = -2147483649;
  16. int maxInt = 2147483648;
  17. int minIntHex = -0x80000001;
  18. int maxIntHex = 0x80000000;
  19. long minLong = -9223372036854775810L;
  20. long maxLong = 9223372036854775809L;
  21. long minLongHex = -0x8000000000000001L;
  22. long maxLongHex = 0x8000000000000000L;
  23. float minPosFloat = 1.0e-46f;
  24. float maxPosFloat = 1.0e+39f;
  25. double minPosDouble = 1.0e-325;
  26. double maxPosDouble = 1.0e+309;
  27. }
  28. }