groovy - Do grails' getter methods return COPIES of attributes objects, or the attributes objects themselves? -
for instance:
class person { def stuff } class toilet { public void main(string... args){ person person = new person() person.getstuff() //null, point } }
does getstuff()
returns copy of stuff
? or stuff
itself? i'm concerned modifiability of returned stuff
object.
groovy (used grails) returns object itself, objects (def
, object
, person
, etc). can modify object.
and copy primitives (int
, long
, etc).
it's same java.
Comments
Post a Comment