What will be the value of variable b
 
class Program 
{ 
    static void Main(string[] args) 
    { 
        Func<int> d; 
        d = () => 0; 
        d += () => 1;
        d += () => 2;
        int b = d(); 
     } 
}
 
Explanation
Delegate returns a value obtained by calling the last method.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes