Skip to content

Instantly share code, notes, and snippets.

@jungheelee
Last active August 29, 2015 22:52
Show Gist options
  • Save jungheelee/c9b7129acac87879da4c to your computer and use it in GitHub Desktop.
Save jungheelee/c9b7129acac87879da4c to your computer and use it in GitHub Desktop.
String b = "0x7a";
int result = 0;
for (int i = 0; i < Character.getNumericValue(b.charAt(2)); i++) {
result+=16;
}
result+=Character.getNumericValue(b.charAt(b.length()-1));
System.out.println(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment