Local variables of same name in same scope, IDE display error but when I run the program, no run time error results

后端 未结 3 1078
误落风尘
误落风尘 2021-01-26 03:57

I understand that it is illegal to declare local variables of the same name in the same scope. I wrote this very simple class, and yes, the IDE does display an error next to

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 04:45

    This is a compile-time error. Presumably you successfully compiled before introducing the error and are still executing that .class file.

提交回复
热议问题