If you want the toString( ) method of Subclass to return a different value, you'll need to override it in the subclass : Polymorphism : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Polymorphism »

 

If you want the toString( ) method of Subclass to return a different value, you'll need to override it in the subclass


 

    class Superclass {
        public function Superclass(  ) {}
        public function toString(  ):String {
            return "Superclass.toString(  )";
        }
    }

    class Subclass extends Superclass {
        public function Subclass(  ) {}
        override public function toString(  ):String {
            return "Subclass.toString(  )";
        }
    }

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Class
» Polymorphism