In jshell-11, why does a redeclared reference variable that resets to null still have a type?

后端 未结 2 1072
渐次进展
渐次进展 2021-02-19 19:22

When redeclaring Integer \'a\' in line 33, why does jshell show the reference variable as an instance of Integer (refer to lines 38 & 39)? After the redeclaration, line 34 s

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 20:21

    I've raised it as a bug and it's been accepted.

    https://bugs.openjdk.java.net/browse/JDK-8211694

    Good spot.

提交回复
热议问题