FAQ

What is the purpose of a method?

  • To implement the logic required for specific behaviour or functionality in a class.
What is the difference between a parameter and an argument?

  • A parameter is part of the method signature
  • An argument is part of the method call
What is method overloading?

  • Methods with the same name and purpose, but different signatures.
What us method chaining?

  • One method overload called another overload to prevent repeated code.
When is it best to use method overloading vs method overriding?

  • Use overloading when one method requires multiple signatures
  • Use overriding when replacing a method defined higher up in the object hierarchy.










Comments

Popular posts from this blog

Method Overloading

Building a Method