Java, How to save node cooardinates to list : I am creating a shortest route program for a project. Currently I have data being read from a .cav file. The program tells me how many caves (nodes) there is in the file and also gives me the coordinates for each node.

Code:

//Get coordinates

    for (int count = 1; count < ((noOfCaves*2)+1); count=count+2){
    System.out.println("Cave at " + data[count] +"," +data[count+1]);
    }

Output:
Cave at 2,8
Cave at 3,2
Cave at 14,5
Cave at 7,6
Cave at 11,2
Cave at 11,6
Cave at 14,1

How do I now store these locations as x,y into a list?
Thanks :)