Main Function Of Dart
As I said in first article/blog that C language and Dart language both syntax are almost identical. So, the most of data type , keyword , function are same as the C language.
So, today we are learning about the main function of the dart language.
What is main function?
In short term we can also called main function as a entry point of code. Like if we want to go any place such as showroom , café at the time we have to entry with the main gate , there are same concept in main function. Main function work as entry point code due to machine has no thinking power like human so they did not know where to start complier the program and where to end, that's why we use main function to determine the entry point of code , so complier can start executing the program with this line.
The syntax of Main function is:
void main()
{
//write code here
print("Hello World");
}
Here, you are thinking about that why I put the Semi-column at end of the print function , Right!!. The meaning of putting semi column means here the the end of statement. Semi-Column ( ; ) is use to indicate the end of statement.
Subscribe to my newsletter
Read articles from Jinali Ghoghari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by