「プログラミングGroovy」Groovyってなんだろ?編

3,882 views

Published on

2011/05/28 レッツゴーデベロッパー2011@仙台

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,882
On SlideShare
0
From Embeds
0
Number of Embeds
383
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

「プログラミングGroovy」Groovyってなんだろ?編

  1. 1. Java
  2. 2. ‣‣‣‣ Java
  3. 3. ‣‣‣
  4. 4. Java
  5. 5. 2011 2010 2009 2008 2007 2006 2005 20042003
  6. 6.
  7. 7. // Hello.javapublic class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); }}
  8. 8. // Hello.groovypublic class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); }}
  9. 9. // Hello.groovyprintln "Hello, World!"
  10. 10. class Dog { void cry() { println "Bowwow!" }}class Cat { void cry() { println "Meow!" }}void kick(obj) { obj.cry() }kick(new Dog())kick(new Cat())
  11. 11. String.metaClass.shout = { println delegate.toUpperCase() + "!" }"Let’s go developers".shout()
  12. 12. url = "http://dist.groovy.codehaus.org/distributions/groovy-binary-1.8.0.zip"tmpfile = File.createTempFile("ant", ".zip")ant = new AntBuilder()ant.get(src:url, dest:tmpfile)ant.unzip(src:tmpfile, dest:".")
  13. 13. @Grab(org.twitter4j:twitter4j-core:[2.2,))import twitter4j.*twitter = new TwitterFactory().instancetwitter.updateStatus " #5000dai"
  14. 14. Java

×