What is polymorphism?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is polymorphism?

Rating:

Polymorphism is a technique of defining methods in which different objects respond appropriately to the same method name. Polymorphism provides a consistent interface throughout the application and within all objects. For example, many methods in PowerBuilder are polymorphic, such as SetFocus().

  • If the SetFocus() method is called for a CommandButton, the method displays a rectangle around the text.

  • Whereas, if the SetFocus() method is called for a DropDownListBox, the method highlights the edit box of the control.

  • In this example, the action of the SetFocus() method is different for each control.

    There are two categories of polymorphic behavior:
  • Operational polymorphism: Separate, unrelated objects define methods with the same name. Each method performs the appropriate processing for its object class.

  • Inclusional polymorphism: Various objects in an inheritance chain define methods with the same name but with different arguments. With inclusional polymorphism, PowerBuilder determines which version of a method should be executed based on where the current object fits in the inheritance hierarchy. When the object is a descendant, PowerBuilder executes the descendent version of the method overriding the ancestor version.

  • Rating:



    Other articles

    Click here to Article home

     
    uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
    MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
    Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
    © 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.