1
2
3
4
5
6
7
public class Test {
public static void main(String[] args) {
char c = '4';
int t = c - '0';
System.out.println("char转换为数字: " + t);
}
}