In Object-Oriented COBOL, what is polymorphism, and how is it implemented?

  • By controlling program execution
  • By defining the size and type of data
  • By optimizing memory usage
  • Polymorphism allows objects of different classes to be treated as objects of a common superclass. It's implemented through method overloading and overriding.
Polymorphism in Object-Oriented COBOL allows objects of different classes to be treated as objects of a common superclass. It is implemented through method overloading (multiple methods with the same name but different parameters) and overriding (redefining a method in a subclass). This promotes flexibility and enhances code readability.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *