I'm trying to override the toString() method for an equation expression object, but Eclipse seems to delete the ^ symbol. I keep on retyping it and Eclipse highlights the symbol in yellow and then even with just moving the cursor around results in the symbol being automatically deleted, ending up with return variable + "" + power.tostring();
So whenever I modify something in this file, I have to keep in mind that the symbol gets deleted and type it again. How can I solve this? Or even better, is there a way to superscript power.toString() when printing to console?
@Override
public String toString() {
if (reducedExpression) {
return variable + "^" + power.toString();
}