I am trying to access String operation that is in public String postForm, through a public class, but when in public String Sum I try to call optest.postForm (operation), it shows the error cannot find symbol.
public class op {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String postForm(@QueryParam("operacion") String operacion) {
return operacion;
}
}
@GET
@Path("/calculadora/suma")
public String Suma(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Suma(num1,num2));
}
double $Suma(double num1,double num2) {
op optest = new op();
optest.postForm(operacion);
double resultado;
resultado = num1 + num2;
return resultado;
}