Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
22
Task/Abstract-type/ActionScript/abstract-type-2.as
Normal file
22
Task/Abstract-type/ActionScript/abstract-type-2.as
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package {
|
||||
import flash.utils.getQualifiedClassName;
|
||||
|
||||
public class AbstractClass {
|
||||
|
||||
private static const FULLY_QUALIFIED_NAME:String = "AbstractClass";
|
||||
|
||||
// For classes in a package, the fully qualified name should be in the form "package.name::class_name"
|
||||
// Note that a double colon and not a dot is used before the class name. This is the format returned
|
||||
// by the getQualifiedClassName() function.
|
||||
|
||||
public function AbstractClass() {
|
||||
if ( getQualifiedClassName(this) == FULLY_QUALIFIED_NAME )
|
||||
throw new Error("Class " + FULLY_QUALIFIED_NAME + " is abstract.");
|
||||
}
|
||||
|
||||
public function abstractMethod(a:int, b:int):void {
|
||||
throw new Error("abstractMethod is not implemented.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
10
Task/Abstract-type/ActionScript/abstract-type-3.as
Normal file
10
Task/Abstract-type/ActionScript/abstract-type-3.as
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package {
|
||||
|
||||
public class Example extends AbstractClass {
|
||||
|
||||
override public function abstractMethod(a:int, b:int):void {
|
||||
trace(a + b);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue