In Object-Oriented COBOL, what is method overloading, and how is it useful?

  • It allows multiple methods with the same name but different parameters.
  • It enforces encapsulation in classes.
  • It is a technique to override inherited methods.
  • It restricts the use of methods to a single class.
Method overloading in Object-Oriented COBOL refers to the ability to define multiple methods with the same name but different parameters. This is useful for creating more flexible and intuitive class interfaces, allowing methods with similar functionality to be invoked based on the context of usage.
Add your answer
Loading...

Leave a comment

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