error: incompatible types: char cannot be converted to String – Java

You can easily convert the char to String.

char aCharacter = 'c';
String aCharacterAsString = String.valueOf(aCharacter);

So in your case:

a.add(Integer.parseInt(String.valueOf(number.charAt(i))));

Leave a Comment

error code: 523