Passing value in java BEGINNER stuff
<p>i am having a little bit of trouble in my code 
i wish to take the value operation = flip in the last if statement and pass it to the top where operation = "" so that it is either + - or * is this even possible sorry for such a basic question but i am really stuck</p>

<pre><code>JButton operand = (JButton) calculate.getSource();
String flip = operand.getLabel();
String operation = "";
String operation1(operation);
System.out.println(operation);
String value1 = (box1.getText());
String value2 = (box2.getText());
box1.setText(box1.getText() + operand.getLabel());

if (flip == "C")
 {box2.setText("");
 box1.setText(""); }

if (flip == "!")
{int intValueNeg = Integer.parseInt(value1);
int negateIntValue = intValueNeg * (-1);
String negativeInt = Integer.toString(negateIntValue);
box1.setText(negativeInt);}

if (flip == "+" || flip == "-" || flip == "*" ) 
{ box2.setText(value1);
  box1.setText("");
  operation = flip;
   }
</code></pre>
