Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ArrayList<E> ....{
- public <T> T[] toArray(T[] a){
- if(a.length < size)
- return (T[]) Arrays.copyof(elementData, size, a.getClass());
- System.arraycopy(elementData, 0, a, 0, size);
- if(a.length > size)
- a[size] = null;
- return a;
- }
- }
- public E[] toArray(E[] a){
- if(a.length < size)
- return (E[]) Arrays.copyof(elementData, size, a.getClass());
- System.arraycopy(elementData, 0, a, 0, size);
- if(a.length > size)
- a[size] = null;
- return a;
- }
- public E[] toArray(E[] a)
- public <T super E> T[] toArray(T[] a)
- <T super E>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement