You have not initialized your operand stack and you don't do anything with the value returned by the "evaluate" method.
That being said, don't use StringTokenizer but use the "split" method of the String class. Also, Stack class extends Vector class which has all its method synchronized and has fallen out of use except in legacy cases. If you are using Java 6, use a LinkedList class or ArrayDeque class exposed by the Dequeue interface.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
now i am having this problem with evaluating the postfix
*What* kind of problem? You need to be more detailed when posting problem statements rather than just saying you've got a problem.
BTW, the code isn't pretty as far as error checking is concerned. You only test for the first character of a token to verify its correctness. As per your logic, the following postfix expression becomes correct: 1 2 +? and yields 3 but it shouldn't. Similarly, the expression 1b 2 + fails in an unexpected manner.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734