Search My Blog

Thursday, February 14, 2013

Static/dynamic typed languages, strong/weak typed languages

Static typed - check at compile time eg. C, Java, C++
Dynamic typed - check at runtime eg. PHP, JavaScript

Strongly typed - operands in an expressions must be the same type eg. C, Java
c = a + b; //all are integers
c = a + (char)b  //not allowed in strongly typed languages

Weakly typed - operands can be different eg. JavaScript, VisualBasic
c = a + (char)b // all are integers, but the result is determined during runtime. different languages have           /                         // different rules for assigning the type of the result

No comments:

Post a Comment