Adobe Flex Actionscript Question:

Download Job Interview Questions and Answers PDF

How polymorphism works on actionscript?

Adobe Flex Actionscript Interview Question
Adobe Flex Actionscript Interview Question

Answer:

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;
}
}

Download Adobe Flex Actionscript Interview Questions And Answers PDF

Previous QuestionNext Question
What keyword allows you to refer to private variables of a class in flex?How do we overload functions in actionscript?