Groovy – isReverse()

  • Post author:
  • Post category:Groovy
  • Post comments:0 Comments
reversed Range

Is this a reversed Range, iterating backward?

Syntax

boolean isReverse()

Parameters

None

Return Value

Boolean value of true or false on whether the range is reversed.

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.isReverse()); 
   } 
}

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

false

Previous Page:-Click Here

Leave a Reply