package stringexample;
/*
* 1.字符串与基本数据类型、包装类之间的转换
* 字符串---》基本数据类型、包装类:调用相应的包装类的paseXxx(String str)
* 基本数据类型、包装类----》字符串:字符串重载的valueOf()方法
*
* 2.字符串与字节数组
* 字符串---》字节数组:字符串的getBytes()
* 字节数组---》字符串:字符串的构造器
*
* 3:字符串和字符数组
* 字符串---》字符数组:调用字符串的toCharArray()
* 字符数组---》字符串:调用字符串的构造器
*/
public class Turn {
public static void main(String[] args) {
String str1=new String("123");
System.out.println(Integer.parseInt(str1));
int i=1234;
String str2=new String();
System.out.println(str2.valueOf(i));
String str3=new String("abcdefg");
byte [] by=str3.getBytes();
for(byte b:by)
{
System.out.print((char)b);
}
System.out.println();
char [] a=str3.toCharArray();
for(char ch:a)
{
System.out.print(ch);
}
}


}