Is there any real use case for parallel arrays in Java? It seems too cumbersome to maintain N arrays which are interrelated.
Example:
int ages[] =
Parallel arrays are a holdover from languages like Basic (the original one) that had no data structures other than arrays. You should define objects as you suggest, instead.
The only real advantage of parallel arrays in Java is as an (IMO extreme) measure to reduce object allocation and / or heap usage. For a large enough collection of objects, 3 arrays will occupy less space AND use fewer objects than a single array of instances of some custom class.
This approach is normally a bad idea, since it makes your code a lot more fragile. Creating and using a custom class is the best approach in most situations.
Note: the Performance Tips for Android advise otherwise, but those tips are primarily focused on reducing the frequency / impact of GC pauses on user experience. And even that advice is caveated in a couple of ways.
Create Class/Object representation only if what you are trying to represent can be better explained as an object.
Hash Maps are another solution. For example, instead of differnt arrays for ages and names, if the names are unique, you can use the name as keys and age as the value.
Classes are nicer, but if the use case is narrow, e.g. one method body, it's wasteful to create one. If you have a Pair class, you could specialize it for the purpose without creating a new class.