MCQOPTIONS
Saved Bookmarks
| 1. |
What will be the output of given 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("Csharp"); Console.WriteLine(g.pop()); Console.ReadLine(); } } |
| A. | Compile time error |
| B. | Csharp |
| C. | 0 |
| D. | Run time error |
| Answer» C. 0 | |