[英]Scope of public method in private class in java - no package
I have encapsulated variables in a private data class inside of a public data structure, if I have a public method in the private class, what can access that method? 我在公共数据结构内部的私有数据类中封装了变量,如果私有类中有公共方法,则可以访问该方法吗?
If I have a class that can access the private object through a get method in the public class can the first object access the public get or set method in the private class? 如果我有一个可以通过公共类中的get方法访问私有对象的类,那么第一个对象可以访问私有类中的公共get或set方法吗?
If you need any other information please let me know. 如果您需要其他任何信息,请告诉我。
有权访问private
成员类型的任何人都将依次访问其public
成员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.