Thursday, September 5, 2019

c# - Can someone explain it to me what closure is in real simple language ?











I am currently looking at lambda expression and the word closure keeps coming. Can someone explain it to me in real simple language.


Answer



I'd say this is a duplicate of: What are ‘closures’ in .NET?



"In essence, a closure is a block of code which can be executed at a later time, but which maintains the environment in which it was first created - i.e. it can still use the local variables etc of the method which created it, even after that method has finished executing."


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...