Derived classes are not required to re-state that they implement an interface from their base class, but are permitted to do so. (This case is special; see below for more details.)
派生类可以指明它实现了其基类的接口,但是并不是一定要这么做。
Marking the base class as "private" allowed the derived class to inherit from it without actually becoming one of them.
将基类标记为 “私有”允许派生类从该基类继承而来,而无需实际成为 一个基类。
We're very glad to see the same principles - which are derived from models such as typical Q&A sites, wikis, and Digg - applied to a broader knowledge base that can be used by power users, too.
我们也很高兴同样的原理——这些原理是从一些典型的问答站点,wiki以及Digg的模式中提取出来的——可以运用到这个针对高级用户的庞大知识库中。
Dynamic casts are needed when we have a reference or pointer to a base class but need to perform operations from the derived class that are not part of the base class.
当具有基类的引用或指针,但需要执行不是基类组成部分的派生类操作的时候,需要动态的强制类型转换。
There is no automatic conversion from the base class to a derived class.
从基类到派生类的自动转换是不存在的。
Classes can implement an interface in addition to being derived from a base class. Listing 12-10 contains an example.
类可以实现一个接口并附带地从一个基类派生。清单12 - 10包含了一个例子。
If the base member took different arguments than the derived-class member, there would be no way to call the derived function from a reference or pointer to the base type.
如果基类成员与派生类成员接受的实参不同,就没有办法通过基类类型的引用或指针调用派生类函数。
Copies members from the base class to the prototype associated with the derived class, and continues this process up the inheritance chain.
将成员从基类复制到与派生类相关联的原型,并沿继承链向上继续执行此过程。
Programs must use memory and time to construct fields inherited from a base class even when the derived class makes no use of them.
程序必须花费内存和时间来构造从基类继承的域,即使导出类根本不使用它们。
The question here… Why can't I write an implicit operator from a Base class to a Derived class in C#?
这里的问题……为什么我不能写一个隐式操作符从基类派生类在c#中?。
When a base type is specified as a parameter in a method declaration, any type that is derived from the base type can be passed as the corresponding argument to the method.
当方法宣告将基底型别指定为参数,则从此基底型别衍生的任何型别都可以当做对应引数传递给方法。
If a class inherits from another class, the methods and members of the base class are available to users of the derived class as if they were direct members of the derived class.
如果一个类是从另一个类继承的,则派生类的用户可以使用基类的方法和成员,就如同这些成员是派生类的直接成员一样。
The following simple example shows the standard way to declare events in a base class so that they can also be raised from derived classes.
以下简单示例演示了在基类中声明可从派生类引发的事件的标准方法。
What is the best way to display in a view more types that are derived from an abstract base?
在查看更多的类型,是来自一个抽象表现的最好方法是什么?
You have two ways to differentiate your new derived class from the original base class it inherits from. The first is quite straightforward: you simply add brand new functions to the derived class.
你有两种方法去区分衍生类和它所继承的原始基类:你可以简单的为衍生类加入标识性的方法。
When a base type is specified as a parameter in a method declaration, any type derived from the base type can be passed as the corresponding argument to the method.
如果一个方法的参数使用基类型,可以使用任何一个继承自这个基类型的类型作为参数调用这个函数。
When you define a class that inherits from a base class, you sometimes want to redefine one or more of the base class elements in the derived class.
当您定义从基类继承的类时,有时会需要重定义派生类中的一个或多个基类元素。
In the following example, the data type is converted from the derived class to its base class, but the object that both variables now point to is unchanged.
在以下范例中,资料型别从衍生类别转换为其基底类别,但转换后两变数所指向的物件并未变更。
In such a case, you want the element to be accessible both from the base class and from all derived classes.
在这种情况下,您希望可从基类和从所有派生类均可访问该元素。
This constructor is called by derived-class constructors to initialize the base class and is not intended for use directly from your code.
此构造函数由派生类构造函数调用以初始化基类,不适合直接在代码中使用。
This constructor is called by derived-class constructors to initialize the base class and is not intended for use directly from your code.
此构造函数由派生类构造函数调用以初始化基类,不适合直接在代码中使用。
应用推荐