codecamp

Groovy getFrom()方法

获取此范围的较低值。

句法

Comparable getFrom()

参数

没有

返回值

范围的较低值。

例子

下面是一个使用这个方法的例子 -

class Example { 
   static void main(String[] args) { 
      // Example of an Integer using def 
      def rint = 1..10; 
      println(rint.getFrom()); 
   } 
}

当我们运行上面的程序,我们将得到以下结果 -

1
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定