你可以导航到使用,声明,继承,基类和更多—交叉语言。
You can navigate to usages, declarations, inheritors, base types and more - across languages.
到这里为止,我们学习了如何声明一个类,如何初始化它们,以及继承的一些基础。
So far, we've covered how to declare classes, how to instantiate them, and some of the basics of inheritance.
继承抽象类的子类必须实现在其父类或自身中声明为抽象的所有抽象方法。
A child class that extends an abstract class must implement all abstract methods in its parent or itself be declared abstract.
实现层次结构在Scala中的效果是相同的:我们可以向方法应用final来防止子类覆盖它,也可应用于类声明本身来防止继承。
Implementation hierarchy works the same way in Scala: We can apply final to the method to prevent a child class from overriding it or to the class declaration itself to prevent derivatives.
声明内部类Collab,Collab继承了RuntimeCollaborator抽象类并实现了在MBean描述符中为MBean声明的操作和属性(图2)。
Declare an inner class, Collab that extends the RuntimeCollaborator abstract class, and implements the operations and attributes declared for the MBean in the MBean Descriptor (Figure 2).
对于构建器而言,要声明的扩展点是or g .eclipse . core . resources . builders,而实现类则必须继承org . eclipse . core . resources . incrementalprojectbuilder类。
For builders, the extension point to declare is org.eclipse.core.resources.builders, and the implementation class must extend the org.eclipse.core.resources.IncrementalProjectBuilder class.
继承是一种方法,通过它,类的对象可以访问以前精确定义过的类中的成员变量和函数,而不用重新声明那些定义。
Inheritance is the means by which objects of a class can access member variables and functions contained in previously defined class, without having to restate those definitions.
说明:标识类或接口的所有已声明成员的集合。不包括继承成员。
Identifies the set of declared members of a class or interface. Inherited members are not included.
在代码中,可以通过声明一个类继承自另一个类来指定对象间的继承关系。
In code, you can specify inheritance relationships between objects by declaring that one class inherits from another.
类似地,声明式安全使您可以控制类的继承。
Similarly, declarative security allows you to control inheritance of classes.
类的成员包括在类中声明的所有成员,以及在该类的继承层次结构中的所有类中声明的所有成员(构造函数和析构函数除外)。
A class's members include all the members declared in the class, along with all members (except constructors and destructors) declared in all classes in its inheritance hierarchy.
隐藏和重写都在派生类继承基类时使用,并且都是用另外的元素重定义一个已声明的元素。
Shadowing and overriding are both used when a derived class inherits from a base class, and both redefine one declared element with another.
隐藏和重写都在派生类继承基类时使用,并且都是用另外的元素重定义一个已声明的元素。
Shadowing and overriding are both used when a derived class inherits from a base class, and both redefine one declared element with another.
应用推荐