阅读背景:

java数据类型转化

来源:互联网 
public class test { public static void main(String[] args) throws Exception { // int---->String int a = 10; String str = a + ""; String str1 = String.valueOf(a); String str2 = Integer.toString(a); System.out.println(str + " " + str1 + " " + str2); // String---->int String s = "123"; int b = Integer.parseInt(s); int c = Integer.valueOf(s); System.out.println(b); // Stirng---->char[] String str3 = "abc"; char[] ch = new char[str3.length()]; for (int i = 0; i < str3.length(); i++) { ch[i] = str3.charAt(i); } } } public class test { public static void main(Strin



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: