
-----------------------------------
Prince
Wed Feb 18, 2004 11:15 am

output
-----------------------------------
i keep getting this error saying:
The variable "output" may be accessed here before having been definitely assigned a value.

wut the heck does that mean :? ... heres the part im workin with

    public String toString ()
    {
        String output;
        if (coeff > 1 || coeff < 1 && exp > 1 || exp < 1)
            output = "" + coeff + "x^" + exp;
        if (coeff == 1 && exp > 1 || exp < 1)
            output = "x^" + exp;
        if (coeff == -1 && exp > 1 || exp < 1)
            output = "-x^" + exp;
        if (coeff == 0 && exp == 0)
            output = "";
        if (coeff == 0 && exp > 1 || exp < 1)
            output = "x^" + exp;
        if (coeff == 1 && exp == 0)
            output = "1";
        if (coeff == -1 && exp == 0)
            output = "-1";
        return output;
    }


-----------------------------------
Dan
Wed Feb 18, 2004 11:26 am


-----------------------------------
it means tat output may never be give a value, it is a dum error tho.

just chage:

String output;

to 

String output = "";
