fork download
  1. class Main {
  2. public static void main(String[] args) {
  3. int v = 1234566;
  4. System.out.println("Integer.toHexString(v): " + Integer.toHexString(v));
  5. String hexV = "";
  6. while (v > 0) {
  7. int rem = v & 15;
  8. v >>= 4;
  9. hexV = "0123456789ABCDEF".charAt(rem) + hexV;
  10. }
  11. System.out.println("Calculated: " + hexV);
  12. }
  13. }
Success #stdin #stdout 0.14s 50224KB
stdin
Standard input is empty
stdout
Integer.toHexString(v): 12d686
Calculated: 12D686