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
I've raised it as a bug and it's been accepted.
https://bugs.openjdk.java.net/browse/JDK-8211694
Good spot.
The problem is that, though it says it is set to null, it actually isn't. See added comments in bug for more detail.
I've changed the bug title to: JShell: Redeclared variable should be reset
I'll attempt to fix in JDK 12.
The second issue is not a bug, Java does not allow instanceof operators that cannot be true -- behavior matches javac exactly.