I have these data from two different files like these:
file 1 :
- 1001, Name One
- 1002, Name Two
- 1003, Name Three
- 1004, Name Four
- 1005, Name Five
file 2:
- 1001, 1234, 450
- 1002, 2345, 560
- 1003, 3456, 730
- 1004, 4567, 200
- 1005, 5678, 1000
as seen from the date above they have reference with each other (1001, 1002, … , 1005)
my question what is the proper way to combine them into a single array and retrieve them via there references.
You could work with a Map
then you could store the first file, with all these id´s in an ArrayList.
In the second file you could simply look up the values and write both of them into the Map