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.
C#
C# Quiz
Learn C# Online

or Read more about C# Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback