------ Solution ---------------------------------------- ----
char c = '1';
int i = (int) (c - '0');
System.out.println(i);
------ For reference only ---------------------------- -----------
char c = '1';
int result = Integer.valueOf(String.valueOf(c));
System.out.println(result);
没有评论:
发表评论