Difference Between final and const Keywords in Dart | Dart Tutorial for Flutter in Hindi | #13

  Рет қаралды 19,058

Ahirlog

Ahirlog

3 жыл бұрын

The final and const keywords are similar in that they are used to declare variables whose value cannot be changed after they are initialized. However, there are some key differences between the two keywords:
final: The final keyword is used to declare a variable whose value cannot be changed after it is initialized. The value of a final variable is determined at runtime. This means that the value of a final variable can be different for different objects, but once it is set, it cannot be changed.
const: The const keyword is similar to final, but the value of a const variable is determined at compile time. This means that the value of a const variable is the same for all objects, and it cannot be changed.
Here are a few key differences between final and const:
Scope: final variables are only accessible within the scope they are declared in, while const variables are accessible throughout the entire app.
Performance: const variables are evaluated at compile time, which means they are faster at runtime than final variables.
Modification: final variables can be modified within a constructor, while const variables cannot be modified at all.
My KZbin Gear:
Boya BYM1(Mic): amzn.to/3bvm69j
Redmi Note 7 Pro(Mic & Camera): amzn.to/3uRkVsb
MSI Motherboard: amzn.to/3fiQHYO
Intel i3 Processor: amzn.to/3w8TWbQ
Mouse: amzn.to/3yb8PMP
Keyboard: amzn.to/3bvmtkd
Wifi Adaptor: amzn.to/3fiQYuO
SSD: amzn.to/3w2w2Pa
Speakers: amzn.to/3w6pKhv
----------------------------------
Dart final and const keyword | Tutorial for Flutter | #12
• Final and Const Keywor...
Difference Between var and dynamic Keywords in Dart | #11
• Difference Between var...
Dart Dynamic keyword | Hindi | #10
• Dynamic keyword in Dar...
Dart var Keyword | Hindi | #9
• Var Keyword in Dart | ...
Dart String and String Interpolation | #8
• Strings and String Int...
----------------------------------
Instagram: / ahirlog
Facebook: / ahirlog
Twitter: / ahirlog
KZbin: / ahirlog
#ahirlog #flutter #dart
Last Summer by Ikson: / ikson​
Music promoted by Audio Library • Last Summer - Ikson (N...

Пікірлер: 17
@iShahzainAhmed
@iShahzainAhmed 7 ай бұрын
Wonderfully explained!!
@arpankaibartya4441
@arpankaibartya4441 2 жыл бұрын
very nicely explained man. You deserve more subscribers
@ahirlog
@ahirlog 2 жыл бұрын
Support
@nikhilpatil8013
@nikhilpatil8013 3 жыл бұрын
awesome bro Keep it up!
@ahirlog
@ahirlog 3 жыл бұрын
Thanks bro
@faizivlogsofficial8678
@faizivlogsofficial8678 Жыл бұрын
sir are you talking about declare or initialize
@reactnativedeveloper1682
@reactnativedeveloper1682 2 жыл бұрын
THANKS BHAI LOVE U BHAI AP AI DART VIDEO BANATY RAHO
@ahirlog
@ahirlog 2 жыл бұрын
welcome bhai
@vishalgupta-wp2sy
@vishalgupta-wp2sy 3 жыл бұрын
good explanation
@ahirlog
@ahirlog 3 жыл бұрын
Thanks ☺️
@RashedulIslam-gs2zl
@RashedulIslam-gs2zl 2 жыл бұрын
Thank you
@ahirlog
@ahirlog 2 жыл бұрын
Thanks 👍
@samratkilledar
@samratkilledar 8 ай бұрын
What about Object ? if we declared variable final and const with object ?
@olabanjoolakunori5151
@olabanjoolakunori5151 2 жыл бұрын
Try to use subtitles to reach a large audience
@MalikSulaman-ni2jy
@MalikSulaman-ni2jy 2 ай бұрын
I don't understand Const .
@yaminshahricky9274
@yaminshahricky9274 3 жыл бұрын
It's declares that you know but don't have teaching capabilities.
@khr_brand8295
@khr_brand8295 4 ай бұрын
Exactly
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 19 МЛН
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН
Dart const, final and immutability
9:59
dbestech
Рет қаралды 1,6 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 263 М.
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 19 МЛН