Sunday 27 January 2019

Groovy: Classes


Classes in Groovy are like Java, except some minor differences.
a.   If you do not specify an access specifier to class, methods then the visibility is public by default.
b.   Fields with no visibility modifier are treated as properties automatically. Groovy provides automatic getter and setter methods to the properties.
c.    Class file name not necessarily be the base class name.
d.   Any code that is not inside a class is considered as script



Previous                                                 Next                                                 Home

No comments:

Post a Comment