[Java] public, private, final and basic rules for naming.

  1. Access: publicprivate, protected
  • public: Any other class can access a public field or method. (Further, other classes can modify public fields unless the field is declared as final.)
  • private: Only current class can access. 
  • protected: Accessible within all classes in the same package and within subclasses in other packages.

TODO: good class name rules

TODO: good mehod name rules

TODO: final..

猜你喜欢

转载自www.cnblogs.com/Johnsonxiong/p/10090132.html