DEV102's Programming Job Interview Challenge 6
|« Previous article:||Next article: »|
|DEV102's Programming Job Interview Challenge 5||Blog Home||DEV102's Programming Job Interview Challenge 8|
Another week, another C# interview question from the good folk’s at Dev102.com – Although I use the term “good folks” advisedly, as this week they did not even acknowledge the solution I posted for last weeks puzzle (which was both correct, and, I believe, the first blog post about it).
Anyway, time to move on to this week’s question.
Look at the following Code segment written in C#:
ArrayList a = new ArrayList(); ArrayList b = new ArrayList(); a.Add(1); b.Add(1); a.Add(2); b.Add(2.0); Console.WriteLine((a == b)); Console.WriteLine((a\[1\] == b\[1\]));
What will be typed into the console And WHY?
This one is fairly trivial (They seem to be alternating between difficult and easy questions). And, as requested, I formulated my answer before typing it into VS (actually, I copy’n’pasted in SnippetCompiler), but the compiler DID confirm the answer I’d already theorized.
This answer is short enough that we can use the cool “white-on-white; select to see it” trick— However, RSS feed (and apparently the theme of this blog) seem to ignore the color style, so it’s probably visible to you below..
(select the blank space above)comments powered by Disqus