Understanding the Code
Let’s go over each line of a basic Hello World program in Dart.
We'll cover the following...
Overview
Just to refresh our minds, let’s take a look at the code for our Hello World application.
Press + to interact
main() {// Printing the text 'Hello World'print("Hello World");}
The Print Statement
On line 3 of the program, we are using a print statement which prints the text Hello World. print()
is used to display the output of the code on the console. It follows this syntax:
Press + to interact
print( Insert what you want to print here )
Since Hello World is text, to be able to print it, we need to enclose it in ...