DEV Community

Cover image for Dart Operators Explained in Bangla
Amirul Islam
Amirul Islam

Posted on

1

Dart Operators Explained in Bangla

1. অ্যাথমেটিক অপারেটরস (Arithmetic Operators)

এই অপারেটরগুলো গাণিতিক হিসাবের জন্য ব্যবহৃত হয়।

অপারেটর বর্ণনা উদাহরণ
+ যোগফল a + b
- বিয়োগফল a - b
* গুণফল a * b
/ ভাগফল a / b
% ভাগশেষ a % b

উদাহরণ কোড:

int a = 10;
int b = 5;
print(a + b);  // 15
print(a - b);  // 5
print(a * b);  // 50
print(a / b);  // 2.0
print(a % b);  // 0
Enter fullscreen mode Exit fullscreen mode

2. রিলেশনাল অপারেটরস (Relational Operators)

এই অপারেটরগুলো দুইটি মানের মধ্যে তুলনা করতে ব্যবহৃত হয়।

অপারেটর বর্ণনা উদাহরণ
== সমান কি না a == b
!= সমান নয় a != b
> বড় কি না a > b
< ছোট কি না a < b
>= বড় অথবা সমান a >= b
<= ছোট অথবা সমান a <= b

উদাহরণ কোড:

int a = 10;
int b = 5;
print(a == b);  // false
print(a != b);  // true
print(a > b);   // true
print(a < b);   // false
print(a >= b);  // true
print(a <= b);  // false
Enter fullscreen mode Exit fullscreen mode

3. লজিক্যাল অপারেটরস (Logical Operators)

এই অপারেটরগুলো শর্তের মধ্যে লজিক্যাল সিদ্ধান্ত নিতে ব্যবহৃত হয়।

অপারেটর বর্ণনা উদাহরণ
` `
&& লজিক্যাল AND a && b
! NOT !a

উদাহরণ কোড:

bool a = true;
bool b = false;
print(a && b);  // false
print(a || b);  // true
print(!a);      // false
Enter fullscreen mode Exit fullscreen mode

4. অ্যাসাইনমেন্ট অপারেটরস (Assignment Operators)

এই অপারেটরগুলো ভেরিয়েবলে মান অ্যাসাইন করতে ব্যবহৃত হয়।

অপারেটর বর্ণনা উদাহরণ
= মান অ্যাসাইন করা a = b
+= যোগফল অ্যাসাইন করা a += b
-= বিয়োগফল অ্যাসাইন করা a -= b
*= গুণফল অ্যাসাইন করা a *= b
/= ভাগফল অ্যাসাইন করা a /= b
%= ভাগশেষ অ্যাসাইন করা a %= b

উদাহরণ কোড:

int a = 10;
int b = 5;
a += b;  // a = a + b -> 15
a -= b;  // a = a - b -> 10
a *= b;  // a = a * b -> 50
a /= b;  // a = a / b -> 10.0
a %= b;  // a = a % b -> 0
Enter fullscreen mode Exit fullscreen mode

5. নাল-এওয়ার অপারেটরস (Null-aware Operators)

এই অপারেটরগুলো নাল মানের সাথে কাজ করতে ব্যবহৃত হয়।

অপারেটর বর্ণনা উদাহরণ
?? যদি নাল হয়, তবে ডিফল্ট মান দিবে a ?? b
??= যদি নাল হয়, তবে অ্যাসাইন করবে a ??= b
?. যদি নাল না হয়, তবে মেথড কল করবে a?.method()
! নাল নয় তা নিশ্চিত করে a!

উদাহরণ কোড:

int? a;
int b = 5;
int c = a ?? b;  // c = 5, since a is null
a ??= b;          // a = 5, if a was null
print(a?.toString());  // prints "5" if a is not null
int d = a!;         // Throws error if a is null
Enter fullscreen mode Exit fullscreen mode

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay