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.
[…] Hello World […]