I am looking at the List<> in java and after googling around I couldnt find definte answers to my questions.
I had thought that you would declare as:
but that doenst work, so I have it figured out 2 ways, can someone explain which is better and why? Or another option...
List<Object> item = new List<Object> ();
List<Object> item = null;
List<Object> item2 = new ArrayList<Object>();
The one which sets the value to null is just not yet initialized. You can have the type be of List, but you can't instantiate an instance of list. It's an interface(might be an abstract class, either way you can't instantiate either)
You must instead instantiate some implementing class, arraylist, linkedlist etc.