博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
编程语言的弱类型、强类型、动态类型、静态类型
阅读量:6888 次
发布时间:2019-06-27

本文共 484 字,大约阅读时间需要 1 分钟。

转载: 

 

弱类型:
> "1"+2'12'
 
强类型:
>>> "1"+2Traceback (most recent call last):  File "
", line 1, in
TypeError: cannot concatenate 'str' and 'int' objects
 
动态类型:
>>> a = 1>>> type(a)
>>> a = "s">>> type(a)
 
静态类型:
Prelude> let a = "123" :: Int
:2:9: Couldn't match expected type `Int' with actual type `[Char]' In the expression: "123" :: Int In an equation for `a': a = "123" :: Int
 

 

 
你可能感兴趣的文章
C++中三种正则表达式比较(C regex,C ++regex,boost regex)
查看>>
SQL Server 触发器(转)
查看>>
2015下半年学习技术任务计划书
查看>>
win7下c#特殊文件夹
查看>>
【leetcode】939. Minimum Area Rectangle
查看>>
LeetCode算法题-Rotate Array(Java实现)
查看>>
LeetCode算法题-Degree of an Array(Java实现)
查看>>
修改文件名并去除文件名中的空格
查看>>
模拟退火算法(一)
查看>>
兼容性—H5标签兼容
查看>>
兼容性—IE6下当元素浮动设置margin时会有双边距
查看>>
新学的文件操作,简单的一些整理
查看>>
OS快捷键
查看>>
js转义字符串与解析字符串(%3A%2F%)
查看>>
Centos7 搭建bind9.9
查看>>
【原】iOS学习之三种拨打电话方式的比较
查看>>
简说设计模式——工厂方法模式
查看>>
vue项目在IE11下报错Promise未定义
查看>>
Sharepoint 2013 Secure Store Service
查看>>
9月--菜鸟吐槽日志
查看>>