public class Example5_12 {
    public static void main(String[] args) {
       char c[], d[];
        String s = "中国足球队";
        c = new char[2];                              
        d = s.toCharArray();                             //字符串转换为字符数组
        s.getChars(2, 4, c, 0);
        System.out.println(c);
        System.out.println(d);
        byte b[] = "爱中国".getBytes();                    //字符串转换为字节数组
        System.out.println("数组b的长度是:" + b.length);
        String s2 = new String(b, 0, 2);
        System.out.println(s2);
    }
}
