In terms of ease of use, the Array class is much easier to code. The array [] is a rather complicated problem in terms of the fact that you need to know the size of the list of objects in advance.
Instead, you can use a HashMap. It is very effective for searching, and also for sorting the whole process is performed in terms of key values.
You can declare a HashMap as:
HashMap<String, Object> map = new HashMap<String, Object>();
You can use your class for an object, and for a key, use a value that must be unique.
source share