https://stackoverflow.com/questions/23148347/java-variable-is-already-defined-in-method
You've already define your variable answer2 in line 2, and in your while loop you are trying to redefine the variable answer2, i.e:int answer2 = (int)answer1;
You can do it like :
answer2 = (int)answer1;
앞에 type을 붙이면 새로 선언한다는 의미가 됌!
'코딩 > Java, SpringBoot' 카테고리의 다른 글
[Java] the variable can only be null at this location(NullPointerException의 한 종류) (0) | 2020.07.19 |
---|---|
[Java ]error: unreported exception UnsupportedEncodingException; must be caught or declared to be thrown (0) | 2020.07.18 |
[Java] php의 var_dump()같은 함수 없나? (0) | 2020.07.18 |
에러처리 (0) | 2020.06.26 |
jframe 위치 (0) | 2020.06.11 |