英语翻译(1.)Class constructor,or type initializer,is the method

问题描述:

英语翻译
(1.)
Class constructor,or type initializer,is the method specific to a type as a whole that run after the type is loaded and before any of the type's memnbers are accessed.Class constructors are used for static field initialization.Only one class constructor per type is permitted,and it cannot use the vararg(variable argument) calling convention.Normally,class constructors are never called from the IL code.If a type has a class constructor,this constructor is executed automatically after the type the type is loaded.
However,a class constructor,like any other static method,can be called explicitly.As a result of such a call,the global fields of the type are reset to their initial values.
Calling class constructor explicitly does not lead to type reloading.
(2.)
We now continue our study of object-oriented programming by explaining and demonstrating polymorphism with inheritance hierarchies.Polymorphism enables us to "program in the general" rather than "progtam in the specific."In particular,polymorphism enables us to write applications that process objects that share the same base class in a class hierarchy as if they are all objects of the base class.
(3.)
When creating a class,rather than declaring completely new members,you can designate that the new class should inherit the members of an existing class.The existing class is called the base class,and the new class is the derived class.Each derived class can become the base class for future derived classes.
A derived class normally adds its own fields and methods.Therefore,a derived class is more specific than is base class and represents a more specialized group of objects.Typically the derived class exhibits the behaviors of its base class and additional behaviors that are specific to the derived class.
(4.)
With polymorphism,we can design and implememt systems that are easily extensiblenew classes can be added with little or no modification to the general portions of the application,as long as the new classes are part of the inheritance hierarchy that the application processes generically.The only parts of an application that must be altered to accommodate new classes are those that require direct konwledge of the new classes that the programmer adds to the hierarchy.
(5.)
Properties allow clients to access class state as if they were accessing member fields directly,while actually implementing that access through a class method.
This is ideal.The client wants direct access to the state of the object and doesn't want to work with methods.The class designer,however,wants to hide the internal state of his class in class members,and provide indirect access through a method.
请 不要直接用 翻译软件 好么- -
一看楼下就知道是用金山直接翻译的。
1个回答 分类:综合 2014-10-15

问题解答:

我来补答
(1.)
类构造函数,或键入初始,该方法是特定于载入后的键入和再键入数据被处理前.类构造函数被用于静态初始领域.只有每个类型的类的构造函数是被允许的,而且不能使用可变参数(可变参数)呼叫常规.通常地,类构造函数永远不会从IL代码召出.如果类型被称为是有阶级性的构造,加载后会自动执行此构造类型.
然而,一种类构造函数,像任何其他的静态方法,可称为明确.正是这样的召出结果,该类型的全球字段重置为它们的初始值.
调用类的构造明确不会导致类型的重新载入.
(2.)
我们现在继续我们的研究对象的解释和示范继承性等级.多态性与面向对象编程,使我们能够“计划一般”而不是“在特定的程序.”特别是多态性使我们能够编写应用程序的进程对象,共享在一个类层次结构相同的基类,似乎是基类的所有对象.
(3.)
当创建而不是完全成为新成员的类,您可以指定新的类应该继承现有类.现有的类称为基类的成员,新的类是派生类.每个派生类可以成为未来的派生类的基类.
派生类,通常添加自己的领域和方法.因此,派生类比基类更具体,代表了对象.通常来说派生类展示基类和其他行为的行为特定于派生类.
(4.)
有了多态性,我们可以设计和执行系统,很容易扩展.新的类可以添加很少或根本没有修改应用程序的一般部分,只要新的类的继承层次,应用程序进程的一部分,通常只有一个必须改变,以适应新的类申请的部分是那些需要的新类的直接产品知识,程序员增加到层次结构.
(5.)
属性允许客户端访问类的状态好像他们是直接访问成员字段,而实际执行,通过一类方法访问.
这是理想的.客户要直接访问对象的状态,不想用方法去访问.但是类设计器想要掩盖它在类成员的类的内部状态,并提供间接获得通过方法.
 
 
展开全文阅读
剩余:2000