JAVA based learning - class attributes (static attributes)

  

  When a property is modified static when called class attributes, also called static properties 

  Class attribute: also known as static property 

  Object Properties: also known instance properties, non-static properties 

  If a property declared as class attributes, then all the objects, so a share value 

 

There are two ways to access the class attributes
1. Object Class Properties

teemo.copyright

2. Class Class Properties

Hero.copyright

Both methods can access class properties, namely access and modify acquisition, but it is recommended to use the second  class. Class attribute way to be, which is more in line with semantic understanding

Guess you like

Origin www.cnblogs.com/leemlzm/p/12046625.html