Java Matrix to String toString(Object[][] arr)

Here you can find the source of toString(Object[][] arr)

Description

to String

License

Open Source License

Declaration

public static String toString(Object[][] arr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;

public class Main {
    public static String toString(Object[][] arr) {
        String s = "{";
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1)
                s += Arrays.toString(arr[i]);
            else//  w w  w. j  a va 2 s  .  c  om
                s += Arrays.toString(arr[i]) + ", ";
        }
        s += "}";
        return s;
    }
}

Related

  1. toString(double[][] array)
  2. toString(double[][] data)
  3. toString(int partition[][])
  4. toString(int[][] a)
  5. toString(int[][] matrix)