4

I used following code.

class Bike{
 def manufacturer;

 private getManufacturer(){
  manufacturer
 }

}

But I was able invoke getter method from another class.

Rob Hruska
  • 118,520
  • 32
  • 167
  • 192
Leejoy
  • 41
  • 2

1 Answers1

3

You can't using the private modifier. This is scheduled for Groovy 2.0 I believe

Related questions:

Community
  • 1
  • 1
tim_yates
  • 167,322
  • 27
  • 342
  • 338