-1

I want to return tow values from fallow method public Double MyCalc(double a, double n) { a=a/2; double d; double m; double l; double q=0; double af=0;

    if (n <= 100000000)
    {
        d = n * 0.5 / 100;
        af = (d * a / 100);
        q = d;
       // x1 = af;
        return q;
    }

I want return q and x1

1 Answers1

0

You should make a class for that and return an instance of it.

class QAndX1ButWithABetterNameDependingOnYourApp{
    double q;
    double x1;
}

As a next step, it could make sense to move the whole calculation into that class as well:

static QAndX1 calculate(double a, double b, double c){
    // ... some calculations
    return new QAndX1(q,x1);
}
Thilo
  • 257,207
  • 101
  • 511
  • 656