Closed Soran-M closed 1 year ago
The comments are correct. The variable has been defined before, but the object is created here and only then is the variable initialized using that object.
Another way to see that is to replace the line with e.g. hiDel = new CustomDel(Hello);
. This is equivalent to the shorter version, but more clearly shows that a CustomDel
object is being created.
Based on the conversation, I've added this to the backlog as an enhancement, and added the "help wanted" label to the issue.
@svick 's suggestion would make the code and the explanation clearer. We'll make that change when we next update this article., or anyone can issue a PR and we'll merge it.
@BillWagner I would like to work on this - this is a minor change to made so I'll deliver the PR today.
[Enter feedback here] Hello,
The word create in the 2 comments below are incorrect. The delegate has been already created ahead of these two statements. What is done here is they are initialized.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.