今天见识了Groovy的强悍之处,哈哈,Java还是有点不能比拟啊..
作为一门动态语言,最基本的应该有的要素:
1.动态解释
2.弱类型检查
Groovy与python,ruby的不同之处还在于它可生成Java的bytecode,在JVM上运行.不知道JRuby,JPython是否也是如此的强呢?期待期待!
总的来说,Groovy有三种运行方式:
1.groovyconsole
2.groovysh
3.groovy
其中,groovyconsole是swing类似的GUI窗体控制台,groovysh就是ruby下的irb,可以动态观察运行效果.groovy命令用于直接运行groovy源文件.
唯一的遗憾是groovy竟然不支持java的for循环,相当郁闷.不过有时用for.each的类似语法还是挺爽乎的,总比用iterator强吧.
有些地方要注意:groovy的末尾是可以不带分号的,如果不加return最后一句就是返回的函数结果,这点跟ruby一摸一样.
groovy下解析和生成xml比java里轻松多了,调用几个函数就得了;groovy初始调入groovy.lang.*;groovy.util.*;java.util.*;java.lang.*;
java.io.*;而Java就只有java.lang.*就什么有没了, 少了几个import 还是方便多的.今天先研究这里吧,还要查一下WAP PUSH的资料,啊,是的,虽然我是一个普通的学生,不过我还是很喜欢认识一些志同道合的朋友的,有兴趣的朋友可以通过这个邮箱联系我:
huhengweiboby@163.com.我是小胡.^_^ .各位多多指教啊!这里猛人很多啊,压力很大啊!
分享到:
相关推荐
Groovy in Action, Second Edition is the undisputed definitive reference on the Groovy language. Written by core members of the Groovy language team, this book presents Groovy like no other can—from ...
groovy in action 中文版 2017.11 groovy in action 中文版 2017.11
Groovy in Action的源代码。Groovy in Action的源代码。
groovy in action中文版,带标签
Groovy in Action[文字版][中文] Groovy in Action[文字版][中文]
Groovy IN ACTION
Groovy in action 中英文,API
Groovy in Action Groovy实战 英文第2版 Groovy in Action Groovy实战 英文第2版
groovy in action 详细语法讲解,附例子程序, ofbiz 学习必备。
Groovy in Action, Second Edition is a thoroughly revised, comprehensive guide to Groovy programming. It introduces Java developers to the dynamic features that Groovy provides, and shows how to apply ...
《Groovy in Action》是Groovy编程的综合指南,它向Java开发者介绍了Groovy提供的新的动态特性。为了呈现《Groovy in Action》,Manning再次从源头工作,与包括Groovy项目团队成员和经理在内的专家作者团队合作。其结果...
It’s only natural that many readers of the first edition of Groovy in Action (or “Gina” as we say for short) demanded an update that we are now happy to deliver as the second edition (codename ...
Groovy in Action is a comprehensive guide to Groovy programming, introducing Java developers to the new dynamic features that Groovy provides. To bring you Groovy in Action, Manning again went to the...
这是我自己翻译的,目前还只有第一部分,后续工作还在继续
Groovy是一种语言,其语法类似于Java,但比Java更简单。它通常被视为脚本/灵活/动态的语言,但是我不喜欢这类形容词,因为我认为它们只会令人困惑。如果说Java是一位明智的中年男子,那么Groovy就是他十几岁的儿子。...
Groovy in Action.pdf
groovy in action, 2nd, for unit test writing and gradle DSL
Groovy in Action 配套源码
groovy in action.pdf