In a C# block, I can define and initialize a variable as follows:
var xyz = new Xyz();
The type of xyz
will be set accordingly.
However, at the class level, I have to specify the type twice:
class Abc
{
Xyz xyz = new Xyz();
}
Is there a shorthand syntax that avoids typing out the type name twice?
This isn't such a big deal with short types like Xyz
but a shorter notation would help with LongTypeNames.