i get 'else' without 'if' error
<p>I get 'else' without 'if' error.
Please help, thank you</p>

<pre><code>class MyGraphics
{
    FrameBuffer fb;
    int x, y;
    private int width, height;
    MyGraphics(int wid, int hit)
    {
        fb= new FrameBuffer(wid,hit);
        width = fb.getWidth();
        height = fb.getHeight();
    }
    MyGraphics()
    {
        fb = new FrameBuffer();
        width = fb.getWidth();
        height = fb.getHeight();
    }


    void drawLine(int x1, int y1, int x2, int y2){
    int x0;
    double y0 = y1;
    double slope = (double)(y2 - y1) / (double)(x2 - x1);

    if (x2 &lt; width &amp;&amp; y2 &lt; height)
    {
        for (x0 = x1; x0&lt;=x2; x0++)

        y0=y0+ slope;
    }

    fb.setPixel(x0, ((int)y0));

    else if(x2 &lt; width &amp;&amp; y2 &gt;= height)
    {
        for( y0=y1,x0=x1;  (int)y0&lt; height;   x0++)
            y0 = y0 + slope;
    }
    fb.setPixel(x0, ((int)y0));

    else if(x2 &gt;= width &amp;&amp; y2 &lt;height)
    {
        for (x0 = x1; x0 &lt; width; x0++)
        y0=y0+ slope;
    }
    fb.setPixel(x0, ((int)y0));

    else
    {
        for(x0=x1; x0 &lt; width &amp;&amp; (int)y0 &lt; height;x0++)
            y0 = y0 + slope;
        fb.setPixel(x0, ((int)y0));
    }

    return;
}
void display()
{
    fb.display();
    return;
}

}
</code></pre>
