Private Methoden in groovy ist nicht privat

class A {
    private def sayHello() {
       println "Anish"
    } 
 }

 def a_obj = new A()
 a_obj.sayHello()

Ausgabe : Anish

Gibt es eine Möglichkeit, zu schützen sayHello() im groovy oder bin ich etwas fehlt?

InformationsquelleAutor anish | 2011-10-21

Schreibe einen Kommentar