I wish to whether my understanding is correct.
Problem pro = new Problem();
"pro" can be an object, instance or variable, in delegates it can be referred to method as well. That means "pro" can take several roles depending on the situation.
Object/Instance/Variable/Method
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Mar 4, 2015, 5:14 AM EST
If Problem is a reference type, then 'pro' contains a reference to where a new object (or instance) of type Problem has been created on the heap.
However, if Problem is a value type, then 'pro' contains an actual instance of that type, not a reference to it.
As you say, it is also possible for variables to refer to delegate instances and there is special syntax for adding compatible methods to, or removing them from, the invocation list of that delegate instance.
All the methods can then be invoked, one after the other, by invoking the delegate.
MahaRank #2,573 · 543 reputationPosted Mar 5, 2015, 4:37 AM EST