Sign in

About servlets

wegux edited in Mon, 12 Dec 2022


Why is there a problem with a sum? How can it not recognize the double sum in if

Another problem is that the preview of the web page will not change after my program is modified

1 Replies
commented on Tue, 13 Dec 2022

Your sum is all within the code block and belongs to local variables. A code block corresponds to a method body, and local variables are only valid in the corresponding method body.

To make line 55 effective, define a global variable sum before line 39

After modifying the program source code, you need to click Run to compile it once, because the program executes the compiled file