輸出一維數組可以通過Arrays.toString(arr),那輸出二維數組有沒類似的語句?
java中的array.toString()和array.deepToString()的區別
import java.io.*;
import java.util.Arrays;
public class array2 {
public static void main(String[] args) {
String arr[][] = {{"1","2","3"},{"4","5","6"}};
System.out.println(Arrays.deepToString(arr)); //多維使用這個函數!!
}
}