char[]
a
=b.toCharArray();
a 定义的目标数组
b String类型参数
打印 a[i]
i为任意数~从0开始~
其他类型转换:
string->int
1). int i = Integer.parseInt([String]); 或
i = Integer.parseInt([String],[int radix]);
2). int i = Integer.valueOf(my_str).intValue();
i = Integer.parseInt([String],[int radix]);
2). int i = Integer.valueOf(my_str).intValue();
int->string
1.) String s = String.valueOf(i);
2.) String s = Integer.toString(i);
3.) String s = "" + i;
2.) String s = Integer.toString(i);
3.) String s = "" + i;
string->byte
Byte static byte parseByte(String s)
byte->string
Byte static String toString(byte b)
char->string
Character static String to String (char c)
string->Short
Short static Short parseShort(String s)
Short->String
Short static String toString(Short s)
String->Integer
Integer static int parseInt(String s)
Integer->String
Integer static String tostring(int i)
String->Long
Long static long parseLong(String s)
Long->String
Long static String toString(Long i)
String->Float
Float static float parseFloat(String s)
Float->String
Float static String toString(float f)
String->Double
Double static double parseDouble(String s)
Double->String
Double static String toString(Double d)
Byte static byte parseByte(String s)
byte->string
Byte static String toString(byte b)
char->string
Character static String to String (char c)
string->Short
Short static Short parseShort(String s)
Short->String
Short static String toString(Short s)
String->Integer
Integer static int parseInt(String s)
Integer->String
Integer static String tostring(int i)
String->Long
Long static long parseLong(String s)
Long->String
Long static String toString(Long i)
String->Float
Float static float parseFloat(String s)
Float->String
Float static String toString(float f)
String->Double
Double static double parseDouble(String s)
Double->String
Double static String toString(Double d)