After modification of static variables static random assignment, such wording, really toxic

1, first define a static variable.

2, it is free to re-assignment of static variables.

3, then you'll find the log printed each time this method is called, static variables before computing is not necessarily 1.

Summary: If multiple static random variable is assigned, is likely to cause confusion parameter value, if it is the same argument, define a constant, that is, plus final.

Published 10 original articles · won praise 0 · Views 356

Guess you like

Origin blog.csdn.net/weixin_43137113/article/details/104990656