The out and in keywords in the delegate definitions above specify the delegates to be co or contra variant. out keyword says that, Child class of T can be used instead of T in Func1 definition. While in keyword specifies that the base class of T can be used instead of T in Action1 definition.
Try to play with this code, and try switching the places of out and in keywords in the above delegate definitions.
No comments:
Post a Comment