Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Functions can also return a value. This means when we return to the line where the function was called, it has now carried a number with it. In processing, functions that have no return value are declared with “void” return type.


Example


Code Block
// Function Declaration

...


//This is how the function is named, its return type and parameters defined.

...



int addFive (int paramaterName)

...

 
{

...


	Return paramaterName + 5;

...

}

Function call

...


}

// Function call
// this is how we execute a function 
// functionName(parameter);

...



println( addFive(3) );