Inheritance and abstract classes

The examples I've seen are set up this way:
Super class (abstract class) contains all methods
Subclass overrides methods in super class
Class instances are typed as super class and instantiated as subclass.

I'm wondering why the examples show instances typed as a super class and 
instantiated as a subclass. This makes it necessary for all methods to exist in 
the super(abstract) class and overridden in the subclass. Is this on purpose so 
the abstract class acts as an interface? Wouldn't it be more flexible to type 
and instantiate as the subclass so methods can be added to the subclass that 
don't exist in the super(abstract) class?

I like the idea of abstract classes. I'm just trying to figure out the best way 
to use them.

Thanks.


      
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to