Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    That is the String from a String array.

    Have you tried printing the contents of these arrays: splitNumbers and splitSymbols
  2. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    System.out.println(Arrays.toString(calcOperators));

    Read the API doc for the Array class's toString() method to see what I am talking about.
  3. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    What is the arg to the toString() method? It needs to be an array, not an ArrayList.
    The only arrays I see are: splitNumbers and splitSymbols
  4. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    You can Print out the contents of an array by using this method:
    System.out.println("an ID "+ java.util.Arrays.toString(theArrayName));
  5. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    Go through the array from the split() and use the techniques listed in post#2 to decide where to copy the value.
    Compare the Strings to test for the operators.
    parse the Strings to test for...
  6. Replies
    12
    Views
    1,241

    Re: Adding operands and operators to Arrays.

    For the operators you could compare the Strings against the possibilities.
    For the operands, you could use a parse method inside a try/catch block to see if the String was a valid number.
Results 1 to 6 of 6