运行
class Student1 {
}
Groovy 代码 , 会报错 ;
报错信息 :
groovy.lang.GroovyRuntimeException: This script or class could not be run.
It should either:
- have a main method,
- be a JUnit test or extend GroovyTestCase,
- implement the Runnable interface,
- or be compatible with a registered script runner. Known runners:
* <none>
只有符合如下要求的 Groovy 代码可以运行 :
其它情况的 Groovy 代码 , 均不可运行 ;