ePrivacy and GPDR Cookie Consent by CookieConsent.com
menu

Hello world in Dart

Writing your first Dart program:

I hope You enjoyed my previous article Environment setup for dart. After installing dart on your Pc or using Dartpad our first lines of code in dart ( or any programming language ) is Hello World!  program



In this program, you see Three lines of code. If you are a beginner then ignore the first and third line (Which we sill discuss later in the article ) and focus on the second line.
You find print("Hello world"); Here "print()" is a function( A block of code, Here print is a predefined function whose code is written into the dart SDK ) that is used to print something on the console. You have to Enter some text into parenthesis which is called arguments which should be enclosed with single quotes or double-quotes like this "Hello world". In the future, we will discuss other ways to pass arguments into the print function.

I hope the second line is clear to you not lets jump on the first and third lines of code. So every Dart program starts with a function called "main"  so we have to enter our codes into the main function. in the future, we also learn about this in detail. As a beginner, you just learn first and third line of code and enter your codes into it.

Comments

  1. Hello guys if you got any error, mistake or bug then please comment

    ReplyDelete

Post a Comment