You’re getting that because it’s adding the ASCII value of the char. You must convert it to an int first.
More Related Contents:
- In Java, is the result of the addition of two chars an int or a char?
- Java: parse int value from a char
- Convert int to char in java
- Java – char, int conversions
- How does subtracting the character ‘0’ from a char change it into an int?
- negative char Value JAVA
- How can I convert a char to int in Java? [duplicate]
- Can assign integer value to char but can’t assign integer variable to char
- String index out of range in jva
- Determine if a String is an Integer in Java [duplicate]
- How can I prevent java.lang.NumberFormatException: For input string: “N/A”?
- How can non-ASCII characters be removed from a string?
- Putting char into a java string for each N characters
- Fastest way to iterate over all the chars in a String
- Convert boolean to int in Java
- Scanner method to get a char
- The concatenation of chars to form a string gives different results
- What does an integer that has zero in front of it mean and how can I print it?
- How to Convert Int to Unsigned Byte and Back
- What is the best way to tell if a character is a letter or number in Java without using regexes?
- Comparing chars in Java
- Why does integer division by zero 1/0 give error but floating point 1/0.0 returns “Inf”?
- If a char array is an Object in Java, why does printing it not display its hash code?
- Why is Java able to store 0xff000000 as an int?
- Understanding the difference between null and ‘\u000’ in Java
- Illegal Escape Character “\”
- is it possible to check if a char matches a list of possibilities?
- int[] and Integer[] arrays – What is the difference?
- Integer division in Java [duplicate]
- How do I convert from int to Long in Java?