0

I'm new to Java and trying to figure out how to convert char[] to Character[]. Since ArrayList.add() method only allows Character[], while my charAry is a char[]. Appreciate your time and patience!

List<Character[]> lCharAry = new ArrayList<>();
char[] charAry = new char[50];

for (int j = 0; j < list.size(); j++) {
    for (int i = 0; i < charAry.length; i++) {
        charAry = list.get(j).toCharArray();
    }
    lCharAry.add(charAry);
}
startat
  • 1
  • 1

0 Answers0