Vidyalelo
C# Programming · Q47

Delegates and Events in C Sharp

Programming · C# Programming · question 47

Q47

What will be the output of the following C# code snippet? public class Generic Stack stk = new Stack (); public void push(T obj) stk.Push(obj); public T pop() T obj = stk.Pop(); return obj; class Program static void Main(string[] args) Generic g = new Generic (); g.push(30); Console.WriteLine(g.pop()); Console.ReadLine();

A.
0
B.
30
Answer
C.
Runtime Error
D.
Compile time Error

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board