Skip to content

Instantly share code, notes, and snippets.

@larsw
Created March 21, 2011 19:49
Show Gist options
  • Save larsw/880073 to your computer and use it in GitHub Desktop.
Save larsw/880073 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
//
// Quiz: how can you get this to compile / run / output "Hello World", by only adding three attributes?
//
// Lars Wilhelmsen / @larsw
//
namespace InterfaceInstances
{
public interface IFoo
{
void SayHello();
}
public class Foo : IFoo
{
public void SayHello()
{
Console.WriteLine("Hello World");
}
}
class Program
{
static void Main(string[] args)
{
var foo = new IFoo();
foo.SayHello();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment