View comments | RSS feed

10.2 Interface methods

Classes that implement an interface method must use the public attribute to implement all interface methods that have the same identifier name. The following example shows a class that implements two inherited interfaces with public qualified methods.

interface I 
{
    function f()
}
interface J
{
    function g()
}

class A implements I 
{
    public function f() {}
    public function g() {}
}

Comments


Joe@emeraldforest said on Feb 26, 2008 at 2:02 PM :
interface I
{
function f()
}
interface J
{
function g()
}

class A implements I , J
{
public function f() {}
public function g() {}
}
Francis Cheng said on Feb 26, 2008 at 5:09 PM :
Thanks for catching the error in the class definition, I'll fix it in the source.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification97.html