A few examples of types in the context of programming language can be integer, float, character, string, array, etc. When a program executes then data flow between instructions and values of specific types are assigned to a variable after some operation. It's important for the system to verify if the correct types are used as operands in operations. For e.g. In a sum operation, the expectation for operands to be of numeric type. The program's execution should fail in the case there is inconsistency.
We can classify programming languages into two categories based as per their ability to cater to type safety:
- Dynamically Typed Language
- Statically Typed Language