class Duck { def quack = println("Quack - I'm a duck") } class Hunter { def quack = println("Kwak, I'm a bad ass hunter") } def makeSomeNoise(duck: { def quack }) = { duck.quack } val duck = new Duck val hunter = new Hunter println(makeSomeNoise(duck)) println(makeSomeNoise(hunter))
Friday, September 28, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment