I saw your question in the forums at Sun's website too.
First of all, you need to get exactly clear what you want. You have two strings containing two operators, for example "*" and "+". Now what output exactly do you want?
Do you just want to know which of the two has the highest priority, for example?
You have to write a piece of code that contains a data structure to keep track of the priorities of the different operators, and then you need to lookup the priorities of the two you want to compare. For the data structure, try a HashMap. For example (uses Java 5.0 features):
Your "for" loop loops over every character in "infixStr", but the HashMap only contains entries for a few characters. When the loop hits a character not in the Map, you'll see this exception. So you need to check whether a given character is an operator or not, first. You could just split this line into two and not use auto-unboxing: