- Jun 8, 2005
- 360
- 0
- 76
See the code below. A friend of mine failed this question during an interview for a .NET programming position. The interviewer told him that many candidates failed the question as well. I thought it was pretty straight forward. But I could be wrong. What do you guys think?
Code:
static void Main(string[] args)
{
StringBuilder str = new StringBuilder("Hello World");
GoodDay(str);
Console.WriteLine(str.ToString());
BadDay(str);
Console.WriteLine(str.ToString());
}
private static void GoodDay(StringBuilder str)
{
str.Append(" It is a good day today.");
}
private static void BadDay(StringBuilder str)
{
str = new StringBuilder(" It is a bad day today.");
}