In this blog, we will explore the Static and Dynamically typed language. Whenever I come across these two words I am always overwhelmed by these words. So I decided to do some research and share that information as a blog.
We will look into the difference between static and dynamically typed language and the similarity that exists between them.
Difference between Static and Dynamic Type
Static Type Language
- In statically typed programming languages, type checking occurs at compile time.
- Explicit type declarations are usually required.
- A language is statically typed if the type of a variable is known at compile time.
- Variable assignments are static and cannot be changed.
- Example: C, C++, Java, Rust, Go, Scala
int number = 42
String name = “Mark”
Dynamic Type language
- In dynamically typed language type checking takes place at runtime or execution time
- Explicit type declarations are not required.
- A language is dynamically typed if the type is associated with runtime value.
- Variable assignments are dynamic and can be altered.
- Example: Python, Perl, Ruby, PHP, JavaScript, Erlang
number = 43
name= “Mark”