Writing a Calculator Class

https://nt.dev/s/def15b81abf0

import java.util.*;

public class Calculator {
    double operand1;
    double operand2;
    String operator;

    public Calculator() {
        this.operand1 = operand1;
        this.operand2 = operand2;
        this.operator = operator;
    }

    public double operate(double operand1, double operand2, String operator) {
        double result = 0;
        if (operator.equals("+")) {
            result =  operand1 + operand2;
        } else if (operator.equals("-")) {
            result =  operand1 - operand2;
        } else if (operator.equals("*")) {
            result =  operand1 * operand2;
        } else if (operator.equals("/")) {
            result =  operand1 / operand2;
        }
        return result;
    }

    public static void main(String[] args) {
        double re = 0;
        Calculator calculator = new Calculator();
        re = calculator.operate(operand1, operand2, operator);
        System.out.println(re);
    }
}

There was some errors I don’t know what it is? Please help me

Hi!

You were really close with your solution! You just need to change this line:
re = calculator.operate(operand1, operand2, operator);
to something like:
re = calculator.operate(1, 2, "+");
You can use any numbers and any operator. Nice work!