I have run into these two documentations:
Array
Arrays
and I'm wondering what the difference is between these two classes. They both provide a different set of static methods, but why are they separate? What is the deeper difference? And what is the relation between them and with the normal instance of array like int[]
.
I notice that they are from totally different packages, but still hope to find some clarification. Thanks.
The differences are made fairly clear in the docs.
From Arrays.java:
This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.
From Array.java
The Array class provides static methods to dynamically create and access Java arrays.
Essentialy Array is an implementation of core Array operations - getting, setting and instantiation.
Arrays is a helper class for wrapping common Array operations (conversion between Arrays and Lists, sorting, searching for a value) without polluting the core Array "api".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With