Dart – Hello World

1 0
Read Time:39 Second

Dart – Hello World

In this lesson, you will be going to write the first program – Hello World Program.

void main() {
  print("Hello World");
}
Output: Hello World

Let’s break down the code to understand each line:

void main() – The main() function is the entry point to a program.Curly brackets {} indicate the beginning and end of a function, also known as a code block. Statement inside the brackets determines what the function does when executed.

The print function is used to generate the output.

The Semicolon ; indicates the end of the statement. Each Statement must end with a semicolon.

void before main indicates that this function does not go to return anything(you will learn about this, in the Functions lesson).

In the next lesson, you will learn about Data Types.

Happy
Happy
50 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
50 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “Dart – Hello World

Leave a Comment