简体   繁体   中英

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?

If you need any other information please let me know.

有权访问private成员类型的任何人都将依次访问其public成员。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM