前言:啥也不说了,show me the code!
static List<Integer> intArrayAsList(final int[] a){
if(a == null)
throw new NullPointerException();
retrun new AbstractList<Integer>() {
public Interger get(int i) {
retrun a[i];
}
@Override public Integer set(int i, Integer val){
int oldVal = a[i];
a[i] = val;
retrun oldVal;
}
public int size(){ retrun a.length;}
};
}