In a C # block, I can define and initialize a variable as follows:
var xyz = new Xyz();
The type xyzwill 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 for printing a type name twice?
This is not such a big problem with short types, xyzbut a shorter notation could help with the LongTypeNames names.
source
share