Polymorphism Demo : Polymorphism : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Polymorphism »

 

Polymorphism Demo


 

  class UnpaidIntern extends Employee {

    override public function receivePayment():Number {
      return 0;
    }

  }

  class Manager extends Employee {
  
    override public function receivePayment():Number {
      return baseSalary*3;
    }

  }
  class Engineer extends Employee {

    override public function receivePayment():Number {
      return this.baseSalary*2;
  }

  }
  class Employee {

    internal var baseSalary:Number = 1000;

    public function receivePayment():Number {
      return this.baseSalary;
    }

  }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Polymorphism