ExamVeda
Login
Home
Delegates and Events in C Sharp
?

What will be the output of the following C# code?
public class Generic<T>
{
    public T Field;
}
class Program
{
    static void Main(string[] args)
    {
        Generic<int> g2 = new Generic<int>();
        Generic<int> g3 = new Generic<int>();
        g2.Field = 8;
        g3.Field = 4;
        if (g2.Field % g3.Field == 0)
        {
            Console.WriteLine("A");
        }
        else
        Console.WriteLine("Prints nothing:");
        Console.ReadLine();
    }
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.