什么是强类型的方式在.NET框架? [英] What does strongly typed means in .NET framework?
问题描述
今天上午通过一本书,我发现了一个段落如下所述准备:
This morning was going through a book where I found a paragraph as stated below :
表中的每个数据字段是一个强类型数据成员,完全符合.NET的通用类型系统。的
请问上面的线是指是对象不同语言编写的可以互相交流,如
Does the above lines means " that objects written in different languages can interact with each other like "
如果这意味着什么呢正是上面一行是指上述行说种不同的语言可以互相喜欢互动
And if it means the above lines what does exactly the above line means by saying different languages can interact with each other like
我试图找出一个例子,但没有成功到现在。
I am trying to work out with an example but no success till now.
或者是它的东西,我很想念和需要知道的。请帮我明白了。
Or is it something that i am missing and need to know. Please help me to understand.
在此先感谢
推荐答案
有关,例如你不能乘或除两个不同的类型,即字符串VS整数
For e.g you cannot Multiply or Divide two different types i.e String vs Integer
var answer = 1 * "1"; // you cannot do this
您必须明确地投它,这就是所谓的强类型
You have to explicity cast it, this is known as strongly typed
在这里,如果你在PHP看到
where as if you see in php
$x = "3" * 1; // is correct in php
所以这里你不需要显式地转换了。
So here you dont need to explicitly cast it.
这篇关于什么是强类型的方式在.NET框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!