Groovy – getTo()

  • Post author:
  • Post category:Groovy
  • Post comments:0 Comments
Get

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

Previous Page:-Click Here

Leave a Reply