what has changed about groovy class properties after the GINA book? -
i reading groovy in action (gina) book. in chapter 9, there listing:
class myclass { def first = 1 def getsecond() { first * 2 } public third = 3 } obj = new myclass() keys = ['first', 'second', 'third', 'class', 'metaclass'] assert obj.properties.keyset() == new hashset( keys ) // fail
however, following assert right one:
keys = ['first', 'second', 'class'] assert obj.properties.keyset() == new hashset( keys )
so, has changed groovy class properties after gina book? thank you.
from forum book, looks bit error, or changed , no 1 sure what.
you're better getting access meap second edition of book covers groovy 2
Comments
Post a Comment