2011年12月29日 星期四

Java int to String(整數轉字串)

Java int to String(整數轉字串)
  1. String stringValue = Integer.toString(12345);
  2. String stringValue = String.valueOf(12345);
  3. String stringValue = new String(""+12345);
 
 
Java string to int(字串轉整數)
  1. int intValue = Integer.valueOf("12345");
  2. int intValue = Integer.parseInt("12345");

沒有留言:

張貼留言