The syntax you are referencing is the initializer of the object collection. This is useful when initializing an instance of different types. It by itself does not create an instance of a certain type.
For example, you can use it to declare arrays:
int[] nums = new int[] { 1, 2, 3 };
Lists:
List<int> nums = new List<int> { 1, 2, 3 };
Dictionary:
Dictionary<string, int> pairs = { { "One", 1 }, { "Two", 2 }, { "Three", 3 } };
You can still embed things to achieve your original intent with a little code:
new[] { 1, 2, 3 }.GetLength(0);
source share