Hello World Program in Dart


This code is written in the Dart programming language and defines a simple program that prints the text "Hello World" to the console output. Here's a breakdown of what's happening in this code:

  • void main(): This line defines the main function of the program. In Dart, main() is the entry point of the program and is the first function that gets executed when the program runs. The void keyword specifies that the function doesn't return any value.
  • print('Hello World');: This line is the body of the main() function, and it uses the print() function to output the text "Hello World" to the console. In Dart, the print() function is used to display text or other values in the console output.

Overall, this program is very simple, but it demonstrates the basic structure of a Dart program and how to use the print() function to display text in the console output.

Source Code

/*void main()
{
  print('Hello World');
}
*/

//single-line function
main() => print("Hello World"); 
To download raw file Click Here

Output

Hello World