Dart "Hello, World!" Program

This program prints "Hello, World!" in dart programming language.

Built-in dart function print() is used to diplay or print some string or text in standard output unit. Following program displays Hello, World! in dart.

Dart Source Code: Hello World Program


void main() {
  print("Hello, World!");
}

Output: Hello World Program

Hello, World!

Code Explanation

Every dart program must have a top-level main() function, which acts as the entrypoint to the application. void before main() function is return type of this function. In dart, main() function returns void. To be a valid dart program, we must have main() function. main() is predefined & unique function in Dart.

Instruction within {} after void main() are executed one by one as they're defined.

In this program, we have print("Hello, World!"); which prints string "Hello, World!" to the output.