Code example for NoSuchElementException

0
        return next != null; 
    } 
     
    @Override 
    public final T nextElement() { 
        if (next == null) throw new NoSuchElementException(); 
        try { 
            return next; 
        } 
        finally { 
            next = null; 
        } 
    } 
} 
Experience pair programming with AI  Get Codota for Java