How can I convert this into Java(Android) code?
a = input()
asplit = a.split()
mapy = map(int, asplit)
suma = sum(mapy)
I've tried this:
EditText marks;
String value= marks.getText().toString();
String[] myList = value.split(" ");
int marksfinal=Integer.parseInt();
but it doesn't work I want to convert the user input which will be digits, into an array of digits, them calculate the sum of the array.
42 38 -50, result is 30.int marksfinal=0; for(String s : myList) marksFinal += Integer.parseInt(s);