Thuta Learning
ရှာဖွေရန်
BasicProgrammingbeginner

Syntax & Hello World

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

Dart program တစ်ခုရဲ့အခြေခံဖွဲ့စည်းပုံက function, statement, comment, expression တို့ပါဝင်ပါတယ်။ Code ကိုဖတ်ရလွယ်အောင် comment ရေးနိုင်ပြီး expression တွေက calculation သို့မဟုတ် value ထုတ်ပေးတဲ့အစိတ်အပိုင်းတွေဖြစ်ပါတယ်။

dart
void main() {
  // Single-line comment: one short note
  print('Dart is clear and practical.');

  /*
   Multi-line comment:
   Use this when you need longer notes.
  */
  print(10 + 5);
}

print('...') က text ကိုထုတ်ပြပြီး print(10 + 5) က 10 နဲ့ 5 ကိုပေါင်းပြီး result ထုတ်ပြပါတယ်။ Comment တွေက program output မထွက်ပါဘူး—developer ဖတ်ဖို့အတွက်သာဖြစ်ပါတယ်။

You should see
Dart is clear and practical. 15

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Opening brace { နဲ့ closing brace } မညီတာက beginner တွေမှာအများဆုံးဖြစ်တဲ့ syntax error ပါ။
Syntax & Hello World | Thuta Learning