小测试

2019-04-14  本文已影响0人  luckee

split

class Test{
    public static void main(String[] args) {
        String s1 = "how;do;you;say;";
        String s2 = "how;do;you;say";
        String[] arr1 = s1.split(";");
        String[] arr2 = s2.split(";");
        System.out.println(arr1.length);//4
        for(String s : arr1){
            System.out.println(s);
        }
        System.out.println(arr2.length);//4
        for(String s : arr2){
            System.out.println(s);
        }
    }
}

byte[] bytes = new byte[0]

class Test {
    public static void main(String[] args) {
        byte[] bytes = new byte[0];//这种写法第一次见
        System.out.println(bytes);
    }
}
上一篇下一篇

猜你喜欢

热点阅读