Wednesday 6 October 2021

MetaProgramming Meta Class in Groovy Scripting groovy training telugu 45

 Watch This Video


package therealdanvega

//meta class
//Expando e= new Expando()
//e.writeCode={-> println "$nsme loves to write code....."}

class Developer{


Developer dan= new Developer()"Dan"
dan.metaClass.wrutwCode={-> println "$name loves to write code...."}

String.metaClass.shout={-> toUpperCase()}
println"hello dan".shout()

No comments:

Post a Comment

Note: only a member of this blog may post a comment.