I am new to Java, I want to store an array of pair of doubles. My code looks like this:
import java.util.ArrayList;
import java.util.Map.Entry;
List
Couldn't you just use
public class MyClass extends ArrayList{
private A first;
private B second;
public MyClass(A first, B second){
super();
this.first = first;
this.second = second;}
}
and then add some form of add method, along with a first and second accessor & mutator method? I'm sort of new to programming, but this way would seem like it might work, and be accessible to things other than just the DOUBLE, (in case down the road you want to use other types, like Integer, or even String).