import java.util.*;
public class ListInserter {
  /**  ��List�б��а�˳�����һ���� */
  public static void insert(List<Integer> list,int data){
    ListIterator<Integer> it=list.listIterator();
    while(it.hasNext()){
      Integer in=it.next();
      if(data<=in.intValue()){
        it.previous();
        it.add(new Integer(data));  //����Ԫ��
        break;
      }
    }
  }请问这里的it.previous();是什么意思啊,previous()是在哪个类中的啊,我木有找到呢

解决方案 »

  1.   

    返回列表的前一个元素。该方法可能重复调用以向后遍历列表,或者和next 联合调用来向后或向前。(注意交替调用next和previous将重复返回相同的元素。) Returns: 
    the previous element in the list. 列表的前一个元素。 
    Throws: 
    NoSuchElementException - if the iteration has no previous element. 如果迭代中没有前一个元素抛出。
    给分吧……
      

  2.   

    http://tech.ccidnet.com/art/3737/20030215/449613_1.html
    详细请看这个网址。
    自己导的包裹  怎么不知道是哪个类,   ⊙﹏⊙b汗……
      

  3.   

    next是往后滚动,这个就是往前滚动~
      

  4.   

    按住ctrl点击previous去看源代码
      

  5.   

    ListIterator java.util.AbstractList.listIterator()
    arraylist的父类
      

  6.   

    it.previous() 获取list中前一个元素,至于他的实现,要查找传入的list是List的哪个实现类,然后在那个类里可以找到ListIterator的实现