fork download
  1. case class Foo (val i : Int) {
  2. def doIt() = println(i)
  3. }
  4. object Main {
  5. def main(args: Array[String]) {
  6. val foos = List(Foo(1), Foo(2), Foo(3))
  7. foos.foreach(_.doIt)
  8. }
  9. }
Success #stdin #stdout 0.27s 247424KB
stdin
Standard input is empty
stdout
1
2
3