Private Member Access Java

后端 未结 7 2289
盖世英雄少女心
盖世英雄少女心 2020-12-05 16:29

Is the private member access at the class level or at the object level. If it is at the object level, then the following code should not compile

    class Pr         


        
7条回答
  •  余生分开走
    2020-12-05 17:17

    Class level. The idea is that the code of a class (but nothing else) knows how to handle objects of that class.

    If you have access to the class source code anyway, there is little sense in "hiding" anything from you.

提交回复
热议问题