[JAVA] Conversion of int and char types

Preface

Do 529. Minesweeper game found stuck here

int converted to char

int i = 9;
char c = (char)(i+'0')

char to int

char c = 'a';
int i = c - '0';

reference

[Java] Mutual conversion between int and char types

Guess you like

Origin blog.csdn.net/jokerxsy/article/details/114261095