daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Iterator<T> iterator() {
  2.   return new Iterator<T> () {
  3.     int pos = 0;
  4.  
  5.     @Override
  6.     public boolean hasNext() {
  7.       return pos < arr.length;
  8.     }
  9.  
  10.     @Override
  11.     public T next() throws NoSuchElementException {
  12.       if (hasNext) return arr[pos++];
  13.       else throw new NoSuchElementException;
  14.     }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top