Given what was said in the help doc's it seems like a reasonable way to avoid using null as an initialiser which can only be a good thing in avoid null ref exceptions.
...
A reference type has a default value of null. Correct?
Balaji has replied to your comment:
Hi Kerry,
I had implemented the code in this blog post initially in VB.Net and later used an online converter to do the C# conversion for the sake of creating this blog post. The converter had introduced this and i did not notice it. Sorry, I do not know what that means. But, the C# version did build and run ok in AutoCAD.
Please do let me know if you have any information on it.
This is the converter that i had used for my VB.Net to C# conversion :
converter.telerik.com
Thanks
Balaji
View the post and comment: http://adndevblog.typepad.com/autocad/2015/11/mleader-text-that-reflects-mleaderstyle-settings.html?cid=6a0167607c2431970b01b8d17b453d970c#comment-6a0167607c2431970b01b8d17b453d970c
public T Foo<T>() {
...
...
...
return default(T);
}
Dim variable As T = Nothing
The most common usage is in a Generic class, not when you create a new object form a known type.Code: [Select]public T Foo<T>() {
...
...
...
return default(T);
}
Probably converted from VB.NET where you can useCode: [Select]Dim variable As T = Nothing