Im trying to compile this code, but I keep getting a compile error: '(' or ' What am I doing wrong? Thanks in advance
public class Postfix {
public static void main(String[] args) {
Stack<Integer> stack = new Stack<Integer>(); ------> HERE
while (!StdIn.isEmpty()) {
String s = StdIn.readString();
if (s.equals("+")) stack.push(stack.pop() + stack.pop());
else if (s.equals("*")) stack.push(stack.pop() * stack.pop());
else stack.push(Integer.parseInt(s));
}
System.out.println(stack.pop());
}
}