abstract methods/polymorphism


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: abstract methods/polymorphism

  1. #1
    Mark Destrampe Guest

    abstract methods/polymorphism


    I have declared an abstract method in an abstract class at the top of a hierarchy.
    Two more abstract classes derive from the parent class. Then two more concrete
    classes derive off of each of the former two abstract classes, thus making
    four concrete classes at the bottom of the hierarchy. The methods that are
    being called by the abstract method is are at the bottom of the hierarchy,
    how do I make the two intermediate classes of the hierarchy recognize this
    abstract method so that the bottom classes of the hierarchy will recognize
    the abstract method?

  2. #2
    Kent Guest

    Re: abstract methods/polymorphism


    Mark,

    Sounds like you need to consider redesigning. If the top-level abstract class
    needs to invoke methods defined in it's subclasses then this is a flawed
    design.

    Is it possible that the methods these abstract methods are invoking are relevant
    to the top level class? If so, move them into the top level class and declare
    them abstract.

    Perhaps post some code to better illustrate...

    Regards,
    Kent


    "Mark Destrampe" <mrdestra6008@webmail.winona.edu> wrote:
    >
    >I have declared an abstract method in an abstract class at the top of a

    hierarchy.
    > Two more abstract classes derive from the parent class. Then two more

    concrete
    >classes derive off of each of the former two abstract classes, thus making
    >four concrete classes at the bottom of the hierarchy. The methods that

    are
    >being called by the abstract method is are at the bottom of the hierarchy,
    >how do I make the two intermediate classes of the hierarchy recognize this
    >abstract method so that the bottom classes of the hierarchy will recognize
    >the abstract method?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center