I am to c# and have been putting programs together through modification of existing code in visual studio. I am looking for some guidance to understand the difference between two ways of creating a list. both compile:
List <int> myList;
//versus
List <int> myList = new List <int>();
It’s not subtle. One creates a list and one does not.
The first one simply declares a reference to a list. You would have to create the list later, before using it.
The second one declares a reference to a list and creates a list and sets the reference to refer to the new list, all at the same time.