更新时间:2023-12-05 14:47:52
在 groovy 脚本中,您可以像这样声明和访问它的静态方法:
in groovy script you can declare and access static methods of it like this:
class A{
static void greet(String name){
println "hello $name!"
}
}
//code without class declaration will be executed as part of script.run() method
A.greet("world")