Arrays.toString()的作用是用來很方便地輸出數組,而不用一個一個地輸出數組中的元素。
這個方法是是用來將數組轉換成String類型輸出的,入參可以是long,float,double,int,boolean,byte,object
型的數組。
Random rand = new Random();
byte[] b = new byte[16]; rand.nextBytes(b); System.out.println(Arrays.toString(b));
結果就是16個-128~127內的隨機整數