1.

What are functions different from methods?

Answer»

Functions

  • Self-contained code that performs a specific task.
  • Identified by their name to call whenever a task is required.
  • To DECLARE a function, use func.
  • Use . -> to separate function parameters PARENTHESIS and return type.

METHODS

  • Associated with a particular type.
  • The first PARAMETER name is given by default.
  • Enumeration and Structure define methods.


Discussion

No Comment Found