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
The delegate returns the value obtained by calling the last method.

Follow CodeGalaxy

Mobile Beta

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