Method Definition

Method Definition

A method must be defined before it is used anywhere in the program. The general form of method definition consist of two parts.

Method Header/prototype

Body of method

Method Header

A method header/prototype is the first line of method definition that tells the compiler about the method name, type of value returned by the method, and the types of arguments to be passed, if the function is expected to return  some result, then the function prototype reveals the data type of the result.