method declaration

noun
UK /ˈmɛθəd ˌdɛkləˈreɪʃən/
US /ˈmɛθəd ˌdɛkləˈreɪʃən/

A method declaration is the line of code that tells the computer a method's name and what it needs.

The method declaration says the method is called add and takes two numbers.


OTHER MEANINGS

2. The part of a program that announces a method before its full code is written.

She wrote the method declaration first and filled in the body later.

3. A formal statement in code that names a method and lists its inputs and output type.

The compiler checks each method declaration for errors.

4. In some languages, a promise that a method exists somewhere in the program.

The header file contains only the method declaration, not the code.