You're missing the s
in input.split("\\+");
. Should be input.split("\\s+");
. The way you're doing it won't split anything, leaving pVelocity
to be "60 45 100 30 20"
, which is not a number, hence
java.lang.NumberFormatException: For input string: "60 45 100 30 20"