Right now I have an Arraylist in java. When I call
myarraylist.get(0)
myarraylist.get(1)
myarraylist.get(2)
[0, 5, 10, 16]
[24, 29, 30, 35, 41, 45, 50]
[0, 6, 41, 45, 58]
are all different lists. What I need to do is get the first and second element of each of these lists, and put it in a list, like so:
[0,5]
[24,29]
[0,6]
I have tried different for loops and it seems like there is an easy way to do this in python but not in java.