大名鼎鼎的java动态脚本语言。已经通过了sun的认证

源代码在线查看: ambigouslistormethodtest.groovy

软件大小: 1630 K
上传用户: hjf
关键词: java sun 动态 脚本
下载地址: 免注册下载 普通下载 VIP

相关代码

				class AmbigousListOrMethodTest extends GroovyTestCase {								    void testLocalVariableVersion() {				        def foo = [3, 2, 3]								        def val = foo [0]				        println val				        assert val == 3				    }								    void testUndefinedPropertyVersion() {				        try {				            def val = this.foo [0]				            println val				        }				        catch (MissingPropertyException e) {				            println "Worked! Caught missing property $e"				        }				    }								    void testMethodCallVersion() {				        def val = foo([0])				        println val				        assert val == 1				    }												    def foo(int val) {				        println "Calling foo method with a int param of val"				        println val				        return null				    }								    def foo(List myList) {				        println "Calling foo method with a list param of $myList"				        return myList.size()				    }								}			

相关资源