package z;
public class z {
public static void main(String[] args) {
String s = "123";
char[] c = s.toCharArray();// String转换为char[]
for (int i = 0; i < c.length; i++) {
System.out.println(c[i]);
}
int s_ = Integer.parseInt(s);// String转换为int
System.out.println(s_);
double s__ =Double.parseDouble(s);// String转换为double
System.out.println(s__ );
}
}
原文地址:https://www.cnblogs.com/wym-1999/p/9588861.html
时间: 2024-10-11 12:34:48