Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M-ZubairAhmed/42ad3f496bbc0ddd17f9b785c6f5b0b6 to your computer and use it in GitHub Desktop.
Save M-ZubairAhmed/42ad3f496bbc0ddd17f9b785c6f5b0b6 to your computer and use it in GitHub Desktop.
Conversion from a Decimal Number to Binary & Hexadecimal Number
int decimalNum;
//Converts decimal number to binary, where regex is 2
Integer.toString(decimalNum,2);
//Converts decimal number to hexadecimal, where regex is 16
Integer.toString(decimalNum,16);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment