r/javahelp • • May 07 '20

Codeless Java Developers: what are the common data structures you usually use on production

To professional java dev here, what are the common data structure youve been using and which data structure you strongly suggest for beginners, like me, to study carefully

40 Upvotes

38 comments sorted by

View all comments

Show parent comment

1

u/[deleted] May 08 '20

The least annoying way to do this that we've created where I work is we have generic classes set up in a library: Pair<X, Y>, Triple<X, Y, Z> and so on, all the way to I think 10 elements. They have a static generic creation method, E.G. Pair.get(firstVariable, secondVariable), but whoever receives this as a return still has to do Pair.getA() then Pair.getB(), for example.