Because the entire body of the method is a single block, I can define and use local variables within the body without any problems.
因为整个方法是一个块,所以我可以毫无问题地在正文中定义并且使用局部变量。
Variables declared with a method are local to that method and cannot be used outside of it.
方法内部声明的变量是局部变量,在方法外部是不能够使用的。
Static local variables retain their value between method calls.
静态局部变量会在方法调用之间保留它们的值。
应用推荐