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 Vinit Mepani directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Vinit Mepani
Vinit Mepani
"Hello World, I'm Vinit Mepani, a coding virtuoso driven by passion, fueled by curiosity, and always poised to conquer challenges. Picture me as a digital explorer, navigating through the vast realms of code, forever in pursuit of innovation. In the enchanting kingdom of algorithms and syntax, I wield my keyboard as a magical wand, casting spells of logic and crafting solutions to digital enigmas. With each line of code, I embark on an odyssey of learning, embracing the ever-evolving landscape of technology. Eager to decode the secrets of the programming universe, I see challenges not as obstacles but as thrilling quests, opportunities to push boundaries and uncover new dimensions in the realm of possibilities. In this symphony of zeros and ones, I am Vinit Mepani, a coder by passion, an adventurer in the digital wilderness, and a seeker of knowledge in the enchanting world of code. Join me on this quest, and let's create digital wonders together!"