this constructor clause

There are 1 entries for the tag this constructor clause

Knowledge nugget: the 'this' constructor clause

Knowledge nugget...catchy heh?!? I come across this some time ago and have since used it pretty heavily - its nothing new, but certainly a useful feature. Its used when overloading constructors in your classes, so you have for example... public class Foo { public Foo(string arg1) { // Implementation for arg1 } public Foo(string arg1, string arg2) : this(arg1) { // Implementation for arg2 } } So the top constructor with one argument is called when using the second constructor, so you only need the...

Posted On Friday, January 25, 2008 12:43 PM | Feedback (0)

Copyright © Steve Clements

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski