问题描述:
英语翻译
(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.)
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.
请 不要直接用 翻译软件 好么- -
一看楼下就知道是用金山直接翻译的。
问题解答:
我来补答展开全文阅读