谁能帮我翻译一下,不要翻译软件翻译的

来源:百度知道 编辑:UC知道 时间:2024/05/22 15:45:02
The Two Types Offered by the CLR: Reference Types and Value Types
The CLR supports two kinds of object types: reference types and value types. Of the two, you will run into reference types much more often. Reference types are always allocated from the managed heap and the new operator returns the memory address of the object – the memory address refers to the object’s bits. There are some performance considerations to consider when working with reference types. First, the memory must be allocated from the managed heap, which could force a garbage collection to occur.
The CLR also supports “lightweight” types called value types. Value type objects are usually allocated on a thread’s stack (although they can be embedded in a reference type object) and the variable representing the object does not contain a pointer to an object; the variable contains the value of the object itself. Since the variable contains the object’s value, a pointer does not have to be dereferenced in or

由统计复用两种: 参考价值类型的种类和支持统计复用两种对象类型:类型和参考价值类型. 上述两个,你会更常碰到的参考类型. 参考类型总是分配由新经营效益和管理堆内存地址对象 -内存地址所指的对象的比特. 有些工作绩效考量,考虑当参考类型. 首先,必须分配内存从管理堆,这可能迫使垃圾发生. 还支持统计复用的"轻量级"类商品种类称为. 通常价值型物体分配一个线程的栈(虽然他们可以参考嵌入型物体) 代表和可变对象不包含指针的对象; 可变物体本身含有价值. 自变量包含对象的价值 指不须dereferenced为了操纵物体. 价值型物体不受到控制的压力大大减轻了拾荒者的管理堆 而收藏所需人数降低其寿命超过申请. <. NET框架参考文献清楚地表明这是种类型,其中类型是参考价值类型. 当仰视型的文件,任何类型称为"级"是指类型. 例如,对象类,除了在课堂上filestream阶级、阶层都是随机参考类型. 在另一方面,该文件是指每一个价值型"结构". 例如,int32结构、布尔结构、小数结构、商品种类都timespan结构. 如果可能的话,你应该使用类型而不参考价值,因为你的应用类型的表现会更好. 特别要申报作为一种价值型若以下全部属实: ●行为型原始型●喜欢的类型不需要继承自任何其他类型—次 电子类不会有任何其他类型的对象从它的种类●不经常通过 因为这会引起争议的方法频繁内存拷贝操作伤害表现. 拳击、unboxing认识价值类型的打火机体重比参考类型,因为他们不是在设法拨出堆、 不是垃圾,不要提及的指点. 不过,有许多情况下,你一定要以价值型指针对象. 举例来说,如果你想要添加一个整数5arraylist,那么你的代码将像这样: