1

I came across dynamically typed python, statically typed f#, strongly typed C++ and weakly typed JavaScript.

I do not yet know exact differences between all these type systems. In general, I could figure out that Strong typing is associated with static typing, and weak typing is associated with dynamic typing.

Can somebody explain each type systems with examples.

hrishikeshp19
  • 8,838
  • 26
  • 78
  • 141

1 Answers1

1

Python is dynamically, strongly typed. Types cannot be arbitrarily, implicitly converted from one to another, and names can be bound to objects of any type.

PHP is dynamically, weakly typed. Certain types will be implicitly converted if appropriate, and variables can be assigned any type.

Java is statically, strongly typed. Types cannot be converted except up their inheritance or interface hierarchy, and variables can only be assigned subclasses or implementing objects.

C is statically, weakly typed. Certain types can be converted when convenient (e.g. char and int), and variables can only contain the type they are declared as.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • still unclear...I understood static(all types assigned at compile time) vs dynamic(all types need NOT be assigned at compile time). But what about strong vs weak. Is it about type conversions? This (http://stackoverflow.com/questions/430182/is-c-strongly-typed) discussion adds to my confusion. – hrishikeshp19 Feb 05 '12 at 08:37