Programming Languages C# Objective
Mar 07, 2013

Which statements are correct about the C#.NET code snippet given below?

Stack st = new Stack();

st.Push("hello");

st.Push(8.2);

st.Push(5);

st.Push('b');

st.Push(true);

Choose the correct answer:
A) Dissimilar elements like "hello", 8.2, 5 cannot be stored in the same Stack collection.
B) Boolean values can never be stored in Stack collection.
C) In the fourth call to Push(), we should write "b" in place of 'b'.
D) This is a perfectly workable code.
Detailed Explanation

Option D is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback