Help the world stop coronavirus! Stay home!

Prev Next

Java / Arrays

How do you print the content of a multi dimensional array in Java?

java.util.Arrays.deepToString(Object[]) method returns a string representation of the content of the single (or) multi dimensioned array.

The below example illustrates how the deepToString method could be used to print the content of a multi dimensional array.

// initializing an object array
 Object[][] ob={{"Welcome "," to "}, {"javapedia", ".net"}};
 System.out.println("The string content of array is:");
 System.out.println(Arrays.deepToString(ob));

Output:

The string representation of array is:
[[Welcome ,  to ], [javapedia, .net]]

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Strings

Comments & Discussions