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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -