Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Collection Classes
Which of the following 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);
Dissimilar elements like "hello", 8.2, 5 cannot be stored in the same Stack collection.
Boolean values can never be stored in Stack collection.
In the fourth call to Push(), we should write "b" in place of 'b'.
To store dissimilar elements in a Stack collection, a method PushAnyType() should be used in place of Push().
This is a perfectly workable code.
Show Answer
Correct Answer:
This is a perfectly workable code.
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment