hi i need you help with this java code
class Activity2 { public static void main(String[] arg) { String[] a = { "12345678", "21324545", "65754376", "23452187", "98700012", "65786889", "99900011", "78040078" }; int sums[] = new int[8]; int sum = 0; String amin = " "; String amax = " "; System.out.print("String Array:-"); for (int k = 0; k < 8; k++) { System.out.print(" "); sum = 0; for (int i = 0; i < 8; i++) { char c = a[k].charAt(i); String c1 = Character.toString(c); int w = Integer.parseInt(c1); sum += w; System.out.print(c); } sums[k] = sum; } System.out.println(); System.out.print("Sums Array:-"); for (int i = 0; i < 8; i++) { System.out.print(" "); System.out.print(" " + sums[i]); } System.out.println(); int max = sums[0]; for (int i = 0; i < 8; i++) { if (max < sums[i]) { max = sums[i]; amax = a[i]; } } int min = sums[0]; for (int j = 0; j < 8; j++) { if (min > sums[j]) { min = sums[j]; amin = a[j]; } } System.out.println("The Maximum number = " + max); System.out.println("The Minimum number = " + min); System.out.println("minimum sum is " + amin); System.out.println("maximum sum is " + amax); } }
for (int i=0;i<8;i++){
char c=a[k].charAt(i);
String c1=Character.toString(c);
int w=Integer.parseInt(c1);
sum+=w;
System.out.print(c);
i need another easy way to do or convert that code that been mark red but give the same result plzzzzzzzzzz