é åã®ä¸èº«ãããã£ã¨æååã«ãã
é åã ã¨toString()ã¨ãã§ããªãã®ã§ã(ãããå罪ã¨ãããã¤ã)
String[] strs = new String[]{ "a", "b", "c" }; System.out.println( strs != null ? Arrays.asList( strs ) : "null" );
ã¨ãããæãã§æ¸ãã¦ããã®ã ãã©ãArrays.deepToString()ã¨ããããããªããã
import static java.util.Arrays.deepToString; ... String[] strs = new String[]{ "a", "b", "c" }; System.out.println( deepToString( strs ) ); strs = null; System.out.println( deepToString( strs ) ); // ãã¹ããããé åãOK String[][] strs2 = new String[][] { new String[]{ "a", "b", "c" }, new String[]{ "x" }, null }; System.out.println( deepToString( strs2 ) );
å®è¡çµæã§ãã
[a, b, c] null [[a, b, c], [x], null]
ããããã°Arrays#deepEqualsã¯åã«ä½¿ã£ããªã¼ã