What is the difference between statically typed and dynamically typed languages?

后端 未结 16 2195

I hear a lot that new programming languages are dynamically typed but what does it actually mean when we say a language is dynamically typed vs. statically typed?

16条回答
  •  一整个雨季
    2020-11-22 02:08

    • In a statically typed language, a variable is associated with a type which is known at compile time, and that type remains unchanged throughout the execution of a program. Equivalently, the variable can only be assigned a value which is an instance of the known/specified type.
    • In a dynamically typed language, a variable has no type, and its value during execution can be anything of any shape and form.

提交回复
热议问题