Use the Integer.parseInt for in which you specify a radix, in this case 16


int i = Integer.parseInt("5FA2", 16);