I'm having trouble accessing a variable of a class I have created within a for loop.

The class I have created is fairly simple and just combines a vector and a double value.

```
public class VectorDistance 
{
    Vector2d v;
    double d;

    public VectorDistance(Vector2d v, double d)
    {
        this.v = v;
        this.d = d;
    }
}

```

and within a method in another class which inherits an ArrayList of these vector distances, I'm trying to access the variables of it but it doesn't seem to want to access it. But for whatever reason it won't let me access it. I've tried value.get(0) etc but that does not work. Any help would be greatly appreciated. It is declared as an ArrayList with type VectorDistance throughout the code.

```
public String NewPositionCheck(Vector2d checkPosition, int blockSize, Types.ACTIONS fromPrevious, List<Types.ACTIONS> previousPositions, ArrayList<Observation>[][] grid, int i, ArrayList <VectorDistance> vd)
{
    double closest = Double.MAX_VALUE;
    for (VectorDistance value : vd)
    {

    }
}

```

all i want is to find the smallest value in the ArrayList, by comparing its double value (d) with value "closest" and then store that position as an integer (which i forgot to add)