Trust me the function isnt depreacated.![]()
Integer intObj1 = Integer.valueOf(String s);
returns a wrapper object corresponding to the to the primitive
value represented by the String object passed as an arguement.
What i was doing was using "Ox7fffffff"
as an arguement which is what the decode() method takes.
to use valueOf() or paseType() you have to omit the "Ox" or "O" or a NumberFormatException will be generated.![]()
these bolth work now:
parseType(String s); returns a primative numeric value represented by a string object pass as an arguement.Code:class Test{ public static void main(String[] args){ try{ Long l = Long.valueOf("7fffffff",16); System.out.println(l); }catch(Exception e){System.err.println(e);} } }
Code:class test{ public static void main(String[] args){ try{ int i = Integer.parseInt("7fffffff",16); System.out.println(i); }catch(Exception e){System.err.println(e);} } }




Reply With Quote