String s = new String("tmp"); Integer a = new Integer(s); a.intValue();
String s = new String("tmp"); Integer a = new Integer(s); int b = a.intValue();
Integer.parseInt(String) throws NumberFormatException if not a number还有一种,可能谁也没想到,不过你想达到上面那种目的千万别用: Object.hashCode(); :P
Integer.parseInt(String s) 接分啊。。呵呵
放心用吧public class zh { public zh() { } public static void main(String[] args){ String s = new String("333222"); Integer a1 = new Integer(s); int a2= a1.intValue(); System.out.println(a2); } }
Integer a = new Integer(s);
a.intValue();
Integer a = new Integer(s);
int b = a.intValue();
Object.hashCode(); :P
}
public static void main(String[] args){
String s = new String("333222");
Integer a1 = new Integer(s);
int a2= a1.intValue();
System.out.println(a2); }
}