某类人是否可以继承一个被nes的类别,或者在C#实施一个被nes的接口?
class Outer : Outer.Inner {
class Inner { ... }
...
}
某类人是否可以继承一个被nes的类别,或者在C#实施一个被nes的接口?
class Outer : Outer.Inner {
class Inner { ... }
...
}
如你写的话,没有(见,即。 但是,如果你的内部接口是另一类,那么你可以这样做。
public class SomeClass : SomeOtherClass.ISomeInterface {
public void DoSomething() {}
}
public class SomeOtherClass {
public interface ISomeInterface {
void DoSomething();
}
}
只要封套在您的体内可见,而不是<条码>,那么是。
<><>><>>>> 不要将这一职位作为对您是否担任任何评注。 我只说允许这样做。
<><>Edit>: 您不能来自内部的一类,但can
public class Base
{
public interface ISomething
{
}
}
public class Derived : Base, Base.ISomething
{
}
A couple of friends was discussing the use of inheritance and how to check if a subclass is of a specific type and we decided to post it here on Stack. The debate was about if you should implement a ...
Hi I have two classes, one called Instruction, one called LDI which inherits from instruction class. class Instruction{ protected: string name; int value; public: Instruction(string ...
I ve not used C++ in a while, and I ve become far too comfortable with the ease-of-use of real languages. At any rate, I m attempting to implement the Command pattern, and I need to map a number of ...
Suppose I have some code like this: class Base { public: virtual int Foo(int) = 0; }; class Derived : public Base { public: int Foo(int); virtual double Foo(double) = 0; }; ...
What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description
I want to extend the FileReference class of Flex to contain a custom property. I want to do this because AS3 doesn t let me pass arguments to functions through event listeners, which makes me feel sad,...
I have the following class structure: class InterfaceA { virtual void methodA =0; } class ClassA : public InterfaceA { void methodA(); } class InterfaceB : public InterfaceA { virtual ...
Consider the Java code below, what would happen if there were no paintComponent method in JPanel class? ... import javax.swing.JPanel; public class ShapesJPanel extends JPanel { public void ...