[ascoders] Re: Interfaces vs extends

  • From: Ralf Siegel <ralf@xxxxxxxxxxx>
  • To: ascoders@xxxxxxxxxxxxx
  • Date: Fri, 03 Sep 2004 22:49:49 +0200


Was meinst Du ?
Sollte es funktionieren ?

Theoretisch schon. Probiere doch mal folgendes (IRenderer mußt du noch bauen)

_________________________________________________________________

class Layer implements IRenderer
{
    public function render(Void): Void{trace("Error.")};
}

und dann:

class ImageLayer extends Layer
{
    public function render(Void):Void
    {
        //[....]
    }
    public function myOwnMethod(): Void{
        //[...]
    }
}

Draussen dann:

var myLayer: IRenderer = new ImageLayer ();

myLayer.myOwnMethod(); // kompilererror


------------------------------------------------------------- Ralf Siegel - Freelance Developer Recommended Listening: Blonde Redhead - Misery Is A Butterfly http://www.blonde-redhead.com -------------------------------------------------------------

------------------------------------------------------
Archiv   : //www.freelists.org/archives/ascoders/
Optionen : //www.freelists.org/list/ascoders
------------------------------------------------------

Other related posts: