Can you imagine a situation when this code compiles and runs?
public void Reset()
{
this = new Foo();
}
See the result: https://dotnetfiddle.net/JheuMu.
Can you imagine a situation when this code compiles and runs?
public void Reset()
{
this = new Foo();
}
See the result: https://dotnetfiddle.net/JheuMu.
This method usually outputs false.
Can you imagine a situation where it outputs true?
static bool Test(out int x, out int y)
{
x = 123;
y = 45;
return (x == y);
}
You can find the solution in .NET Fiddle.
What is the output when you run this code?
try
{
try
{
throw new Exception("A");
}
catch
{
throw new Exception("B");
}
finally
{
throw new Exception("C");
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
See the result: https://dotnetfiddle.net/6SWPqL