Access from anywhere to public components of the class.
从任意位置到类公共组件的接入。
It's reasonable to follow common object-oriented programming practices and have getters and setters in the public interface, but within a class you should always access fields directly.
通常根据面向对象语言的实践,在公共接口中使用Getters和Setters是有道理的,但在一个字段经常被访问的类中宜采用直接访问。
Because clone has protected access in Object and, to call clone , you have to call it through a reference to a class that has overridden clone to be public.
因为clone在Object中是保护访问的,调用clone必须通过将clone改写公共访问的类引用来完成。
应用推荐