The final local variable cannot be assigned

前端 未结 6 1995
说谎
说谎 2020-11-29 23:48

I have an array of seats, and the array has two strings(selected and empty). On mouse click, I want to traverse the array and find the selected seat. When I press the button

6条回答
  •  情书的邮戳
    2020-11-30 00:22

    Without knowing the declaration of seatno, I'd suggest to introduce a new variable in the mouseClicked() method that is not final and does the same job as seatno currently does, as the variable seems only to be used inside that method.

    By the way: Capitalize your class names (data should be Data). Will look much more clear.

提交回复
热议问题