Java Arrays Class
The Java Arrays
class (found in java.util
), has methods that allow you to manipulate arrays.
Arrays Methods
A list of popular methods of the Arrays Class can be found in the table below:
Method | Description |
---|---|
compare() | Compares two arrays |
copyOf() | Creates a copy of an array with a new length |
deepEquals() | Compares two multidimensional arrays to check whether they are deeply equal to each other |
equals() | Checks if two arays are equal |
fill() | Fills an array with a specified value |
mismatch() | Returns the index position of the first mismatch/conflict between two arrays |
sort() | Sorts an array in ascending order |
Properties
Property | Description |
---|---|
length | Returns the length of an array |
The length
property is a built-in Java property, and does not belong to the Arrays class.