[Vala] Difference between Gee.List and ArrayList



Hi,

I'm wondering why the program below compiles.

using GLib, Gee;

public class GListTest {

        static int main (string[] args) {
                Gee.List list = new ArrayList<string> ();
                list.add ("TestString1");
                list.add ("myTest");
                list[0] = "blah";       
                message ("list.size=%d", list.size);
                for ( int i = 0; i < list.size; i++) {

                        message ("%s", list[i]);
                }
                return 0;
        }
}

However when I change "Gee.List list = new ArrayList<string> ();" to
"var list = new ArrayList<string> ();" it doesn't


Jaap



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]