I am trying to do a calculator, and I use some boolean variables to check if a dot has already been added, and if the user is inputting the second number.

The problem is in the lines I commented. I am trying to use those variables later in the ActionListener, but it doesn't let me because of those errors. (The compiler does not point out any other error) I don't know if the variables should be declared somewhere else, please help. Thank you.

```
public class Calculadora extends Frame implements ActionListener, WindowListener

{
  Button btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn0; 
  Button btnSum, btnMin, btnMult, btnDiv, btnDot, btnEq, btnAns;
  Button btnSin, btnCos, btnTan, btnSqrt, btnXpowY, btnLn, btnPi, btnE, btnAbs;
  TextField TxAns, TxOper;
  Label LblOper, LblAns;
  Panel PnlGeneral, PnlOper, PnlSimple, PnlExtras, PnlText;

    public String num1, num2;
    public double ans;
    public boolean punto= false;  
    public boolean segunda= false;  **//Error: Syntax error on token ";", { expected**
    num1="";  **//Syntax error on tokens, ConstructorHeaderName expected instead**
    num2="";

    public static void main(String[] args) throws IOException  **//Syntax error on token "(", ; expected**
    {

```