This example will show how to print an array of values for single and multidimensional arrays. Java Arrays class contains various methods, such as sorting and searching, to work with arrays. Below we will use two functionally similar methods, Arrays.toString for one dimensional and Arrays.deepToString for multi dimensional arrays, to capture a string representation of the contents of the array.