Skip to content

Instantly share code, notes, and snippets.

@Alkimisti
Created March 1, 2021 11:56
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 Alkimisti/ffe90127fccf99701ca81ffc63dae01f to your computer and use it in GitHub Desktop.
Save Alkimisti/ffe90127fccf99701ca81ffc63dae01f to your computer and use it in GitHub Desktop.
public class Decimal2Hexadecimal {
public static void main(String[] args) {
String hex1 = Integer.toHexString(16);
System.out.println(hex1);
String hex2 = Integer.toHexString(128);
System.out.println(hex2);
String hex3 = Integer.toHexString(255);
System.out.println(hex3);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment