Groovy “之间的区别是什么?”;静态def at";及;静态at";

Groovy “之间的区别是什么?”;静态def at";及;静态at";,groovy,geb,Groovy,Geb,我正在看文件 http://www.gebish.org/manual/0.9.2/api/geb/Page.html 并发现处的closer被定义为“static def at”,但在页面中是相同的 static at = null 而不是static def at=null 任何区别。您正在查看文档,在文档中可以看到类/接口/特性是如何定义的。它的呈现方式与您编写类的方式完全相同,等等 当您在Geb中使用它时,您可以跳过static def at=null中的def,因为您使用的是已经定

我正在看文件

http://www.gebish.org/manual/0.9.2/api/geb/Page.html
并发现
处的
closer被定义为
“static def at”
,但在
页面中是相同的

static at = null
而不是
static def at=null


任何区别。

您正在查看文档,在文档中可以看到类/接口/特性是如何定义的。它的呈现方式与您编写类的方式完全相同,等等

当您在Geb中使用它时,您可以跳过
static def at=null
中的
def
,因为您使用的是已经定义的函数/闭包


另外:请改用0.9.2。Geb已在0.12.2中!;)

一点也没有。两者都可以理解为

static Object at;

不需要
def