What does 'private' mean in Groovy?

后端 未结 2 1036
长情又很酷
长情又很酷 2020-12-15 17:45

The following code sets a private method. So how private really is private?

public class Person {
 private String name
}

def u = new Person(name:\"Ron\")
pr         


        
2条回答
  •  余生分开走
    2020-12-15 18:39

    By design Groovy should respect the private modifier, however the current implementation takes no account of it.

    There are further details in groovy call private method in Java super class

提交回复
热议问题