Groovy – plus()

  • Post author:
  • Post category:Groovy
  • Post comments:1 Comment
Appends

Appends a String

Syntax

String plus(Object value) 

Parameters

Value − The object to append to the string

Return Value

This method returns the resulting String.

Example

Following is an example of the usage of this method −

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

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

HelloWorld 
HelloWorld Again

Previous Page:-Click Here

This Post Has One Comment

Leave a Reply