S
sparkles
sorry about the subject - i'm not quite sure what it is i'm asking is called
is there anything wrong with doing this...?
ArrayList al = new ArrayList();
al.add(new MyClass(1, 2, 3, 4)); <-----
or is it better to do this?
ArrayList al = new ArrayList();
MyClass class = MyClass(1, 2, 3, 4);
al.add(class);
also if the arraylist is instantiated using generics as such
ArrayList<MyClass> al = new ArrayList<MyClass>();
does that mean that al.get() will return a MyClass or do i still have to
cast it?
TIA
is there anything wrong with doing this...?
ArrayList al = new ArrayList();
al.add(new MyClass(1, 2, 3, 4)); <-----
or is it better to do this?
ArrayList al = new ArrayList();
MyClass class = MyClass(1, 2, 3, 4);
al.add(class);
also if the arraylist is instantiated using generics as such
ArrayList<MyClass> al = new ArrayList<MyClass>();
does that mean that al.get() will return a MyClass or do i still have to
cast it?
TIA