Character conversion in Java

xiaoxiao2021-03-06  57

1, characters are converted to ASCII values

CHAR Y = 'a';

INT x = (int) y;

System.out.println (x);

The above will get a ASCII value of 97

--------------------------------

2, decimal conversion to 16-based number

Integer.tohexstring (101)

--------------------------------

3, ASCII value conversion into characters

String aa = string.valueof ((char) 13);

转载请注明原文地址:https://www.9cbs.com/read-83612.html

New Post(0)