You can convert a Multidimensional Array toString In Java using the helper utility class for Array called as Arrays.
Example:import java.util.Arrays;
public class MultidimensionalArrayToString {
public static void main(String[] args) {
Integer[][] multidimensionalArray = {{1,2,3,4},{5,6,7,8},{9,10}};
System.out.println(Arrays.deepToString(multidimensionalArray));
}
}
Output:
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10]]
We made use of the deepToString() from the java.utils.Arrays class.
Arrays.deepToString() method returns "null" if the specified array is null.
Returns: a string representation of provided input array
Since: Java 1.5

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!