ciao
ad un certo punto di un programma devo fare una conversione da char a int. ho provato a fare il casting e ad usare Character.getNumericValue, ma in tutti e due i casi:
per 0 mi restituisce 48
per 1 mi resituisce 49
come posso fare?
ciao
ad un certo punto di un programma devo fare una conversione da char a int. ho provato a fare il casting e ad usare Character.getNumericValue, ma in tutti e due i casi:
per 0 mi restituisce 48
per 1 mi resituisce 49
come posso fare?
Non so che cosa tu stia facendo, ma questa:
Da in output questa:codice:public class Test01 { public static void main (String[] args) { char zero = '0'; int i = Character.getNumericValue(zero); System.out.println(zero+ " -> " + i); } }
codice:0 -> 0
<´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
"The answer to your question is: welcome to tomorrow"