using System;
class Foo
{
public static bool operator true(Foo f)
{
return false;
}
public static bool operator false(Foo f)
{
return true;
}
}
class Bar
{
static void Main()
{
if(new Foo())
{
Console.WriteLine("Hello world!");
}
else
{
Console.WriteLine("Ciao mondo!");
}
Console.ReadLine();
}
}
Vi aspettate:
- A. non compila
- B. Hello world!
- C. Ciao mondo!