dynamic class Person{
}
// adding dynamically properties and methods to the object of the class
Person p = new Person();
p.name = "Ramesh";
p.age = 25;
p.printMe = function ():void {
trace (this.name, this.age);
}
the classes which are not marked as dynamic cannot have properties and methods added at runtime. Such classes are called sealed classes.Classes are sealed by default i.e. properties and methods cannot be added dynamically at runtime.
Sealed classes requires less memory as no internal has table is needed to store dynamic properties and have stricter compile-time checking as the compiler can provide better error feedback.
No comments:
Post a Comment