Here you can find the source of toHexOrNegative(int i)
public static String toHexOrNegative(int i)
//package com.java2s; //License from project: Open Source License public class Main { public static String toHexOrNegative(int i) { return toHex(i, "-1"); }//from w w w . j a v a2s. c o m public static String toHex(int i, String $default) { return i != -1 ? Integer.toHexString(i) : $default; } public static String toHex(int i) { return Integer.toHexString(i); } public static String toHex(long n) { return Long.toHexString(n); } }