本文共 449 字,大约阅读时间需要 1 分钟。
前言:啥也不说了,show me the code!
static ListintArrayAsList(final int[] a){ if(a == null) throw new NullPointerException(); retrun new AbstractList () { 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;} };}
转载地址:http://clbsl.baihongyu.com/