Code example for LinkedList

Methods: getLast

0
 
        return element;
    } 
 
    public Object getParent() {
        return this.parents.getLast();
    } 
 
    public Object getParent(int index) {
        ListIterator it = this.parents.listIterator( this.parents.size() );
        int x = 0;
        Object parent = null;
        while ( x++ <= index ) {
            parent = it.previous();
        } 
        return parent;
    } 
 
    public Object removeParent() {
        Object parent = this.parents.removeLast();