Java .add(value) with lists
<p>Basically I've got an input string, my test string is '5 + 4' and I want to check character by character to create a list in the form [5,+,4], ie white spaces are ignored. Also, if my test string was '567+5-1' it would output [567,+,5,-,1] by concatenating the numbers together. Unfortunately, it won't let me do <code>.add(inputChar)</code> to my <code>returnValue</code>, saying symbol not found... any ideas?</p>

<pre><code>import java.util.*;

public class CharacterArray {
    public List&lt;String&gt; splitToChar(String s) {
        List&lt;String&gt; returnValue = new LinkedList&lt;String&gt;();
        char[] chars = s.toCharArray();
        System.out.println(chars);
        int currentNumber;
        for (char inputChar : chars) {
            if (Character.isDigit(inputChar) == true) {
                currentNumber += inputChar;
            } else if (inputChar == '.') {
                currentNumber += inputChar;
            } else if (inputChar == '+') {
                returnValue.add(inputChar);
            } else if (inputChar == '-') {
                returnValue.add(inputChar);
            } else if (inputChar == '/') {
                returnValue.add(inputChar);
            } else if (inputChar == '*') {
                returnValue.add(inputChar);
            } else if (inputChar == '(') {
                returnValue.add(inputChar);
            } else if (inputChar == ')') {
                returnValue.add(inputChar);
            } else {
                System.out.println("Incorrect input symbol");
            }
        }
        return returnValue;
    }
}
</code></pre>
