Groovy – next()

  • Post author:
  • Post category:Groovy
  • Post comments:2 Comments
increments

This method is called by the ++ operator for the class String. It increments the last character in the given String.

Syntax

String next()

Parameters

None

Return Value

The new value of the string

Example

Following is an example of the usage of this method −

class Example { 
   static void main(String[] args) { 
      String a = "Hello World"; 
      println(a.next());         
   } 
}

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

Hello World

Previous Page:-Click Here

This Post Has 2 Comments

Leave a Reply