string from array to int
in
Programming Questions
•
9 months ago
Hello I have an array int Number and a array strings Extra, i want to add the string ammount and add them to the seccond array (sum).
So my code looked like this
Number[2] = Number[2] + Extra[1]);
I got the error that it cant put a string into a int.
Then i found something on the forum see the code bellow but then i get a diffrent error :
ArrayIndexOutBoundsExepsion: 3
Number[2] = Number[2] + Integer.parseInt(Extra[1]);
So my code looked like this
Number[2] = Number[2] + Extra[1]);
I got the error that it cant put a string into a int.
Then i found something on the forum see the code bellow but then i get a diffrent error :
ArrayIndexOutBoundsExepsion: 3
Number[2] = Number[2] + Integer.parseInt(Extra[1]);
1