Practice · 1 of 3
Capture audit
CHALLENGE
Difficulty: advanced+25 XP
Implement static int TotalCaptured() that: creates 10 closures over a shared counter local (all 10 increment the SAME captured int), invokes each once, and returns the counter's final value. Also implement static int TotalDistinct() doing the same but with 10 closures each capturing their OWN copy; invoke each once and return the sum of the 10 copies (each 1) = 10.
Press Submit to check your solution.
Back to lesson: Practice: Delegate drills