java-repl icon indicating copy to clipboard operation
java-repl copied to clipboard

Attempt to assign char an int value results in session termination

Open hasahmed opened this issue 8 years ago • 3 comments

The following line result in session termination. char a = 97 The last line in the following results in session termination int i = 12 char z = (char)i

hasahmed avatar Dec 12 '16 08:12 hasahmed

Or the null character:

Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111 on Linux 3.13.0-49-generic
Welcome to JavaREPL Web Console version 425
 
java> char c = 0;
Session terminated. Starting new session...
java> char c = '0';
char c = 0
java> char c = '\0';
Session terminated. Starting new session...

Parth avatar Dec 31 '16 19:12 Parth

yes this is the first thing I was trying to do and it failed. So yes I can confirm this bug.

krux02 avatar May 29 '17 00:05 krux02

faced the same issue. But mine one is a bit unique.

char c='p'; enc=(char)((int)c+100) // works like a charm

enc=(char)(c^'k') // **session gets terminated **

an1k avatar Jul 25 '18 08:07 an1k