Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to assign char an int value results in session termination #111

Open
hasahmed opened this issue Dec 12, 2016 · 3 comments
Open

Attempt to assign char an int value results in session termination #111

hasahmed opened this issue Dec 12, 2016 · 3 comments

Comments

@hasahmed
Copy link

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

@Parth
Copy link

Parth commented Dec 31, 2016

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...

@krux02
Copy link

krux02 commented May 29, 2017

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

@an1k
Copy link

an1k commented Jul 25, 2018

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 **

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants