English 中文(简体)
c#,java,哪些内容无效?
原标题:What is null in c#, java?
  • 时间:2010-01-08 14:51:07
  •  标签:
  • c#
  • java
  • null

和......一样,0 如同C++一样? 还是有些“特殊”物体? 或许有些东西完全不同?

--————

I 确实知道什么是,问题恰恰是?

问题回答

由于你重新询问执行细节,而不是语气,答案是具体执行。

C#中有三个内容是“核心”。 参考、点和无效类型。

关于《刑法》的C#实施为零点。 (如果借方数是您重新运行的《南半球公约》特定版本的管理点。)

无庸置疑的是,一个无效的点/>以同样方式表示。 在C#中,你可以证明这一点,办法是制造一个不安全的路障,使一个无效点,然后将它变成IntPtr,然后将IntPtr改为(或长期)64个轨道系统。 够了,你们的死亡人数是零。

“无损”的“无损”值类别也以零执行,但采用不同方式。 您

否? j = 无;

我们实际创造的道德等同:

struct NullableInt 
{
    int value;
    bool hasValue;
}

采用适当的准入方法,等等。 当其中一件事被分配为无效时,我们只是用零计来填满全部东西。 价值为零愤怒,瓦勒填满零,因此变成不实;瓦莱地区被定为不实,被视为无效。

我不知道执行细节是C# /CLI的其他执行情况。 如果情况不同,我会感到惊讶;这是执行无效的明确和明智的方法。 但是,如果你对具体的执行细节有疑问,那么你不得不问,谁知道你会再次关心的执行情况。

由于Java和C#在虚拟机器上运行,因此实际上并不代表任何东西,而且在整个安装过程中不一定相同。

哪些事项是“无效的behaviour,其定义是语言规格(详见Dan s和MRFerocius的答复)。 基本上,参考类型变量可以持有,不可参照,是一种特殊价值。

BTW,作为参考点,Java序列ization spec使用单一吨值0x70表示无效。

微软 MDSN:

无效关键词是一字不提,指任何物体。 无效是参考型变量的缺省价值。 普通价值类型不能取消。 然而,C# 2.0引进了无效价值类型。 见《可替代类型》(C# Program Guide)。

http://msdn.microsoft.com/en-us/library/edakx9da.aspx”rel=“nofollow noreferer”

它是一个特别的提法(将其与0区别开来),毫无意义。

无一例外是“参考”,因此,它实际上根本没有提及。

附加内涵:C#参比型号可表示无效(即:无),但价值类型如无意义,则不能表示无效,尽管价值类型可在可赔的一般参考类别中使用。

根本上看不见。 在某些情况下,像PHP这样的一些语言将等于零、虚假、空洞等等。 Java和C#有很强的类型语言。 因此,这些“有益”的默示转换没有发生。 因此,实际上完全无效。 纽埃人只等于无效。 没有任何其他比较。

相当于

#define NULL (void*)0

c++。 基本上,是,是零。

EDIT: Since I apparently didn t word this answer anywhere near correctly...

我指的是:

由于C#在一项证书中运行,Michael Borgwardt说是正确的,我们不知道它是如何在幕后代表的。 然而,如果你采用以下守则:

    unsafe static void Main(string[] args)
    {
        if (((void*)0) == null)
            Console.WriteLine("true");
        else
            Console.WriteLine("false");

        Console.ReadKey();
    }

如果能用“低不安全法”加以编纂,你就会看到,在c#中,无效实际上等于(避免*) 页: 1





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...