Skip to content

Instantly share code, notes, and snippets.

@youngjinmo
Created September 15, 2019 05:35
Show Gist options
  • Save youngjinmo/a11125d0a0325efbc5212f08f09ea6f3 to your computer and use it in GitHub Desktop.
Save youngjinmo/a11125d0a0325efbc5212f08f09ea6f3 to your computer and use it in GitHub Desktop.
deepToString 예제
import java.util.Arrays;
public class exampleCodes {
public static void main(String[] args){
String data = "Hello world";
String[] strArray_01 = data.split("");
String[][] strArray_02 = {strArray_01, strArray_01};
System.out.println(Arrays.toString(strArray_01));
// [H, e, l, l, o, , w, o, r, l, d]
System.out.println(Arrays.deepToString(strArray_01));
// [H, e, l, l, o, , w, o, r, l, d]
System.out.println(Arrays.toString(strArray_02));
// [[Ljava.lang.String;@61bbe9ba, [Ljava.lang.String;@61bbe9ba]
System.out.println(Arrays.deepToString(strArray_02));
// [[H, e, l, l, o, , W, o, r, l, d], [H, e, l, l, o, , W, o, r, l, d]]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment