derived-class
Get derived class properties in base Static method - RIDDLE! :)
I wanted to elaborate on the current project i\'m working on but that would be kind long. Instead I\'ll just post a programming riddle which basically explains what i\'m trying to accomplish. :)[详细]
2023-03-06 05:06 分类:问答How to restrict overrided property to be read only
I am having following code. class A { public virtual int BoardSize { get; set; } } class B : A { p开发者_运维技巧ublic override int BoardSize[详细]
2023-03-05 06:38 分类:问答Operators in derived class redefining but still using parent class
Specifically, I would like to be able to use the ostream operator << in two derived classes from a base class.[详细]
2023-03-03 17:41 分类:问答operator<< in derived classes c++
i have a question for the operatorr << in derived clases ex: if i have class Base { //...... friend ostream& operator<<(ostream& out,Base &B)[详细]
2023-02-28 05:53 分类:问答Applying tests for superclass on derived class
Say you have a C++ class B derived of class A. You have extensive tests set up for class A that you would als开发者_如何学Pythono like to run over instances of class B, as it should fully support A\'s[详细]
2023-02-28 02:25 分类:问答C++ Do I Understand Polymorphism Correctly?
Bar and Box are derived classes of Foo and Foo has a virtual function F() and Bar and Box both have function F(). From what I understand, polymorphism correctly allows Bar.F() instead of Box.F() or Bo[详细]
2023-02-25 01:34 分类:问答Calling a Base Class Construtor in a function of Derived Class
I am trying to call a constructor of a Base Class in a function of Derived Class. Here is the code: Classes:[详细]
2023-02-21 17:46 分类:问答Disabling inherited method on derived class
Is there any way to, in a Java derived class, \"disable\" a method and/or field that is otherwise inherited from a base class?[详细]
2023-02-21 07:43 分类:问答creating a derived class object with existing base class object?
Is there a possibility of (or fast workaround for) creating an object defined as derived a class without creating base class object in memory; instead the derived object should refer to the actually e[详细]
2023-02-18 07:21 分类:问答c++ get base class object from derived class pointer?
Suppose I have Derived* derivedPtr; I want Base baseObject from the derivedPtr; Base baseObject = *derivedPtr; would create the baseObject with the appropriate Base class member variables?[详细]
2023-02-18 02:40 分类:问答