I am trying to convert string base address into long value, I tried with different options that do not work.
Option 1: Long.valueoflong(String).longValue(); //not working
Option 2: Long.parseLong(String,16); //not working
Option 3: BigInteger // not working
public class Strconv {
private static String x1= "0x40000000";
private static long x2;
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
x2= Long.valueOf(x1).longValue();
System.out.println("x2"+x2);
}
catch (NumberFormatException e) {
System.out.println("ERRRORRRRRRRRRRRR");
}
}
}