How we can create List of GString in groovy -
arraylist<gstringimpl> a= ["gaurav " , "ashish"]; println a;
here gives error when used gstringimpl
.
the code below works in groovy 2.4.3:
import org.codehaus.groovy.runtime.gstringimpl arraylist<gstringimpl> = ["gaurav " , "ashish"] println println '' def b = "hello" println b.class.name println b println '' def c = "worl${100 char}" println c.class.name println c
yielding
[gaurav , ashish] java.lang.string hello org.codehaus.groovy.runtime.gstringimpl world
your code should work import org.codehaus.groovy.runtime.gstringimpl
.
Comments
Post a Comment