I don't know why I think this is so cool, because it's such a no-brainer, but I really like the way Groovy added closures to the Thread class:
tmp.groovy:
def stringOne = 'Hello, ';
def stringTwo = 'World!';
Thread.start{sleep(1000); println stringTwo}
Thread.start{sleep(999); print stringOne}
Monday, March 31, 2008
Subscribe to:
Post Comments (Atom)

1 comments:
It's cool :)
thank your share
Post a Comment