Groovy - getTo()



Get the upper value of this Range.

Syntax

Comparable getTo()

Parameters

None

Return Value

The upper value of the range.

Example

Following is an example of the usage of this method −

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

When we run the above program, we will get the following result −

10
groovy_ranges.htm
Advertisements