Introduction
Begin with C# 9.0, when the compiler can know the type in new expression, it is NOT needed to specify the type in new expression.
Example
It is only allowed in C# 9.0 or above.
List<int> xs = new();
List<int>? ys = new();
While, it is NOT always allowed in the following example since the compiler can not know what type it should be.
var xs = new List<int>();