Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert a single character number into an integer number in java
How to convert a single character number into an integer number in java

if it is a single letter of type char, you can directly subtract the zero of type char from the variable of type char and assign it to type int.

the code example is as follows: public? class? Test? {

public? static? void? main(String[]? args)? {

char? c? =? '4';

int? t? =? c? -? ''; < p p> System.out.println("char ("char converted to numbers:?" ? +? t);

}

}