Why would I want to implicitly upcast at declaration? My question arises from the following code from my text book.
private readonly IList<Inventory> _cars = new ObservableCollection<Inventory>();
Why wouldn't I just do this instead.
private readonly ObservableCollection<Inventory> _cars = new ObservableCollection<Inventory>();
If I'm just saving space, why not just do this instead?
private readonly var _cars = new ObservableCollection<Inventory>();
Thanks,