IT/Java
Char To Int (The method parseInt(String) in the type Integer is not applicable for the arguments (char))(getNumericValue)
성준하이
2024. 9. 16. 08:33
반응형
String to Int 는 다들 알다시피 String.ValueOf 함수를 사용하면 된다.
Char To Int 가 출력으로는 나올수 있으나
배열에서 자릿수를 숫자로 할때 에러가 발생하였다.
에러는 아래와 같다.
The method parseInt(String) in the type Integer is not applicable for the arguments (char)
해결법은 아래와 같다.
char c = '1;
int numericValue = Character.getNumericValue(c);
반응형