/* package whatever; // don't place package name! */ import java.util.*;import java.lang.*;import java.io.*; /* Name of the class has to be "Main" only if the class is public. */class Ideone{ public static void main (String[] args) throws java.lang.Exception { Long l = new Long(-1); String s = Long.toHexString(l); System.out.println("-1 = " + s); Long aho = Long.parseLong("-ff", 16); System.out.println("aho = " + aho.toString()); //Long rev = Long.parseLong(s, 16); // error Long rev = (new java.math.BigInteger(s, 16)).longValue(); System.out.println("rev = " + rev.toString()); }}