I can\'t work out what is wrong with the following code in Java:
import java.util.*; public class stringCalculator { String operator_array[] = {\"+\", \"-\"
You can not put statements directly inside a class.
Create a method or a constructor and put the call to put there.
put
public stringCalculator() { operatorPrecedence.put("+", "2"); }
Also, it is good practice to use an upper-case name for the class, like StringCalculator.
StringCalculator