Hi gurus
How to determine Class type of Object in collection?
class Human{...}
class Man extends Human{...}
class Women extends Human{...}
def humans = Human.findAll()
humans.each(){ human ->
// ??? , it is not work
if ( human instanceof Man ) { println "Man" }
if ( human instanceof Woman ) { println "Woman" }
}
Thanks a lot,
Tom