import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num=scan.nextInt();
String array[]=new String[num];
for(int i=0;i<array.length;i++){
array[i]=scan.next();
}
int p=0,p1=0;
String s="";
String s1="";
for(int i=0;i<array.length;i++){
if(array[i].charAt(i)=='+'){
s+=array[i].substring(i+1);
s1+=array[i].substring(0,i);
}
int p=Integer.parseInt(s.trim());
int p1=Integer.parseInt(s1.trim());
System.out.println(p+p1);
}
}
}
Iam getting an error saying number format exception but i tried everything to fix it but cant find a solution. Exception in thread "main" java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException. this is the stack trace i got any help would be much appreciated thanks