Java Data Type How to - Java integer Example

  1. Java Add/Multiply/Subtract two integers, checking for overflow
  2. Java Check if integer is multiple of a number
  3. Java Count chance of duplication for random number within a range
  4. Java Create random number which is less than 11
  5. Java Declare Hexadecimal integer literal
  6. Java Declare integer literals as octal values
  7. Java Decode string in decimal, Hexidecimal and Octal to integer
  8. Java Generated random integers within a range
  9. Java Generate random integer in a range, Rolling the Dice
  10. Java Overflow Int by adding to the Integer.MAX_VALUE
  11. Java Read a Valid Integer from Console
  12. Java Read Integers from console and calculate
  13. Java Use Integer as unsigned Integer


  1. Java Convert an integer into binary, hexadecimal, and octal
  2. Java Convert decimal integer to binary integer
  3. Java Convert decimal integer to hexadecimal number
  4. Java Convert decimal integer to octal value string
  5. Java Convert Decimal to Octal back and forth
  6. Java Convert long to double bitwise
  7. Java Convert octal number to decimal number with parseInt()
  8. Java Convert string to integer


  1. Java Format an int value to a string that is in an approximate, but human readable format
  2. Java Parse and Format Binary Number to Decimal, back and forth
  3. Java Read and write integers with a SeekableByteChannel in little endian format