class wrenwren
{
public static void main(String args[])
{
String b = "234";
int c,d;
c = Integer.decode(b);
d = Integer.valueOf(b);
System.out.println(c);
System.out.println(d);
}
}
结果都是234
{
public static void main(String args[])
{
String b = "234";
int c,d;
c = Integer.decode(b);
d = Integer.valueOf(b);
System.out.println(c);
System.out.println(d);
}
}
结果都是234
decode在内部调用valueOf,可以解析8进制,10进制和16进制数,比如:
Integer.decode("0xFE");