05 Learn to Program in Dart: Static Typing


— Handwritten subtitles — Generated subtitles

Summary (generated by robot):

hi everyone this is Richard we are going to talk about static typing if you remember from last time we were talking about dynamic typing where a variable could be either an integer or a string or a float or really take any other value static type well dart is first of all it optionally typed so you can use dynamic typing or static typing static typing is a little bit different instead of var you were going to use a different type here we are going to use integers the type would be int a equals 1 this is the type this is the variable of course here is the value and if you go ahead and print it be at the same way as if you used bar result down below it equals 1 but here a cannot equal a string it will give you an error that because you said in the beginning from the beginning I am declaring that this variable will be an integer it could change so we could change a equals 2 or 3 and that will still work as long as it as long as it is an integer but it cannot