It's saying that "/" is not a permitted input for "stacknum=Integer.parseInt(tokens[i]);"


  • 0
    L
            else if((tokens[i]!="+")&&(tokens[i]!="-")&&(tokens[i]!="*")&&(tokens[i]!="/"))
            {
                stacknum=Integer.parseInt(tokens[i]);
                result.push(stacknum);
            }
            
    }
    return result.pop();
    }
    

    }


  • 0
    M

    "/" is the string containing the character '/'. Either use the character or use .equals() to compare them correctly. Comparing strings with == compares the addresses, not the content.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.