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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -