Questions tagged «weakly-typed»

9
寻求澄清有关弱类型语言的明显矛盾
我想我了解强类型,但是每次我寻找弱类型的示例时,我最终都会找到简单地自动强制转换类型的编程语言示例。 例如,在这篇名为“ 打字:强vs.弱”,“静态vs.动态 ”的文章中,Python是强类型的,因为如果尝试执行以下操作,则会得到异常: 蟒蛇 1 + "1" Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for +: 'int' and 'str' 但是,在Java和C#中这种事情是可能的,因此我们不认为它们只是弱类型的。 爪哇 int a = 10; String b = "b"; String result = a + b; System.out.println(result); C# int a = 10; …
178 c#  java  python  perl  weakly-typed 

17
C是强类型的吗?
引用维基百科: 支持两种隐式转换的两种常用语言是C和C ++,有时会声称它们是弱类型语言。但是,其他人则认为,这些语言对如何混合不同类型的操作数施加了足够的限制,因此应将两者视为强类型语言。 还有更明确​​的答案吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.