I used following code.
class Bike{
def manufacturer;
private getManufacturer(){
manufacturer
}
}
But I was able invoke getter method from another class.
tim_yates
You can't using the private modifier. This is scheduled for Groovy 2.0 I believe
Related questions:
来源:https://stackoverflow.com/questions/3819794/how-to-define-private-getter-method-in-groovy-bean