Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class ArrayList<E> ....{
  2. public <T> T[] toArray(T[] a){
  3. if(a.length < size)
  4. return (T[]) Arrays.copyof(elementData, size, a.getClass());
  5. System.arraycopy(elementData, 0, a, 0, size);
  6. if(a.length > size)
  7. a[size] = null;
  8. return a;
  9. }
  10. }
  11.  
  12. public E[] toArray(E[] a){
  13. if(a.length < size)
  14. return (E[]) Arrays.copyof(elementData, size, a.getClass());
  15. System.arraycopy(elementData, 0, a, 0, size);
  16. if(a.length > size)
  17. a[size] = null;
  18. return a;
  19. }
  20.  
  21. public E[] toArray(E[] a)
  22.  
  23. public <T super E> T[] toArray(T[] a)
  24.  
  25. <T super E>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement