Code example for ListIterator

Methods: add, previous, previousIndex

0
        if(listOfIntegers.isEmpty()){
             intListIterator.add(i);
           // if(intListIterator.hasNext())intListIterator.next(); 
        } 
        else{ 
            if(intListIterator.previousIndex()>=(listOfIntegers.size()/2))intListIterator.previous();
            intListIterator.add(i);
        } 
    } 
    public static void main(String [] args){
        Ex14LinkedIntegers e14i = new Ex14LinkedIntegers();
        print(e14i.listOfIntegers.size());
        for (int i = 0;i<20;i++)e14i.addInt(i);
        print(e14i.listOfIntegers);
    } 
}