java System类2

来源:互联网 发布:通用域名查询 编辑:程序博客网 时间:2024/06/14 02:36
package com.ylchou.testSystem;public class TestSystem {    public static void main(String[] args) {                String[] str1 = {"a","b","c","d","e"};//        String[] str2 = new String[20];//{"x","y","z"};//        String[] str2 = {"x","y","z",null,null,null};        String[] str2 = {"x","y","z"};                System.arraycopy(str1, 1, str2, 0, 3);                for (int i = 0; i < str2.length; i++) {                        System.out.println(str2[i]);        }        //        String[] str2 = new String[16];        //        str1 = {"a","b"};    }}


控制台输出:

b
c
d