Deep to string

ReturnMethodSummary
static StringdeepToString(Object[] a)Returns a string representation of the "deep contents" of the specified array.

import java.util.Arrays;

public class Main {
  public static void main(String args[]) {
    String s[] = {"a", "b", "c", "d"};
    double d [][]= {
        {0.50, 0.20,  0.20, 0.30},
        {0.50, 1.10,  0.50, 0.80},
        {0.50, 0.70,  0.40},
        {0.50, 0.70},
        {0.50},
    };
    System.out.println(Arrays.toString(s));
    System.out.println(Arrays.deepToString(d));
  }
}

The output:


[a, b, c, d]
[[0.5, 0.2, 0.2, 0.3], [0.5, 1.1, 0.5, 0.8], [0.5, 0.7, 0.4], [0.5, 0.7], [0.5]]
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.