public static void Main () { // This works: HelloPrinter printer = new HelloPrinter(); ActionCaller.Call(printer.Print); // This doesn't: ActionCaller.Call(((IHelloPrinter)printer).Print); }
public static void Main() { // This works: HelloPrinter printer = new HelloPrinter(); ActionCaller.Call(printer.Print); // This doesn't: ActionCaller.Call(((IHelloPrinter)printer).Print); }
static void Main(string[] args) { HelloPrinter.Print(); }