[Solved] Converting an array of single digits to an integer [closed]


For cryin’ out loud — it’s a simple conversion. No fancy functions required.

int[] digits = {1, 5, 3, 6, 3};
int totalNumber = 0;
for (int i = 0; i < digits.length; i++) {
    totalNumber = (totalNumber * 10) + digits[i];
}
System.out.println(totalNumber);

2

solved Converting an array of single digits to an integer [closed]