Java provides a utility class called Arrays (in java.util) with static methods that operate on arrays. Two of the most used are sort() and toString().
Arrays.sort() reorders the elements in ascending order, modifying the array in place:
import java.util.Arrays;
int[] nums = {42, 17, 89, 3, 56};
Arrays.sort(nums);
// nums is now {3, 17, 42, 56, 89}
Arrays.toString() returns a readable string representation of the array:
System.out.println(Arrays.toString(nums));
// prints [3, 17, 42, 56, 89]
Without Arrays.toString(), printing an array directly gives you a memory address like [I@6d06d69c. That string is the default Object.toString() output and tells you nothing about the contents.