Please help me with this question.

That's multiple choice questions.

Which of the following are true about anonymous methods?
1) Anonymous methods have access to the local state of the containing function member.
2) An anonymous method requires an explicit method signature
3) An anonymous method can impact the lifetime of local variables and parameters of the containing function.
4) An anonymous method can access ref and out parameters of the containing function
5) A struct may not declare an anonymous method which directly references member fields.


In my opinion, the correct answers are #1 and #3. Right?

Recommended Answers

All 6 Replies

Slap your professor.. C# doesn't have functions!

i agree with snake...

i agree with snake...

Don't bother posting unless you can add value to the thread. This is the second or third thread this morning where you say "I agree". If you want to get your solved thread count up then help out!

1) Anonymous methods have access to the local state of the containing function member.
- true
2) An anonymous method requires an explicit method signature
- false
3) An anonymous method can impact the lifetime of local variables and parameters of the containing function.
- true
4) An anonymous method can access ref and out parameters of the containing function
- true
5) A struct may not declare an anonymous method which directly references member fields.
-true

commented: Great! +11

Thanks much.
Only I've read in the MSDN library, that an anonymous method cannot access the ref or out parameters of an outer scope.

What would you say?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.