ArrayList in J2ME?

后端 未结 3 647
小鲜肉
小鲜肉 2020-12-19 19:30

I have an arraylist of database records. I want to put it in my J2ME List. But there is no split or arraylist in J2ME. How can I do it? A code example would be nice.

3条回答
  •  春和景丽
    2020-12-19 19:42

    http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/util/Vector.html

    public void asd(){
        MyObject mo = new MyObject();
        Vector v = new Vector();
    
        //Adds the specified component to the end of this vector, increasing its size by one.
        v.addElement(mo);
    
        //Returns the component at the specified index.
        mo = (MyObject)v.elementAt(0);
    }
    

提交回复
热议问题