Dart Programming – Defining a Function

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming defining functions

In this guide, we will discuss Defining a Function in Dart Programming Language. A function definition specifies what and how a specific task would be done. Before using a function, it must be defined. The syntax for defining a standard function is given below −

function_name() {  
   //statements      
}

OR

void function_name() { 
   //statements 
}

The void keyword indicates that the function does not return any value to the caller.

Example – Simple Function Definition

test() { 
   //function definition 
   print("function called"); }

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply