Questions tagged [inheritance]

-2 votes
0 replies
What is the most correct way to fully adapt this code to the MVVM pattern?
I have a DataGrid with a DataGridComboBoxColumn. Each ComboBox should have the same drop-down: the new values entered in the ComboBox (the ComboB...
asked 1 month ago
1 votes
0 replies
Is there a way to create a Fragment of a generic class in Android?
Basically, my problem comes down to the fact that a method in an abstract superclass can not be both abstract and static (i.e. static methods can...
1 votes
1 replies
call base class function in derived class constructor
I know it's OK to call base class function in a derived class constructor, because base class is constructed before derived class.But I'm not sur...
asked 1 month ago
1 votes
0 replies
How to call a function in the R6 parent class, where the parent function relies on other overridden helper functions
I am trying to create a class in R6 which inherits a function from its parent class. However, that function relies on other 'helper' functions wh...
asked 1 month ago
-1 votes
0 replies
How to specialize a templated class to instatiate the template paramerter differently
I want a templatized buffer pool and need a way to specialize the template to handle when the the default constructor is not available. I need t...
asked 1 month ago
0 votes
2 replies
In Python, changing inherited behavior without rewriting the parent class
In Python, I have a class ParentClass. It defines method ParentClass.process(), among the others. ParentClass is inherited by two child classes:...
asked 1 month ago
0 votes
0 replies
What is the role of vtable in virtual inheritance?
How does vtable help in removing diamond problem? This question was asked in an interview. class A{ public: void fa(){ } }; class B:public vir...
asked 1 month ago
0 votes
0 replies
How to inherit a particular block using jinja2?
Want to inherit a block from one template to another in jinja2.But super() keyword gets data of all the blocks.Is there any method to get data fr...
asked 1 month ago
0 votes
1 replies
Ho to hide the private method of base class in C#?
I didn't find the answer to my question, but it seems simple. The main big issue is that I bought some library and some functionality hardcoded i...
0 votes
0 replies
Java - What's the difference between declaring an instance of a subclass by calling its parent first vs. calling itself? [duplicate]
This question already has an answer here: What does it mean to “program to an interface”?...
asked 1 month ago
0 votes
0 replies
Why do nested components not have access to inherited properties?
I have a project in which I have a set of components which extend each other and inherit properties from child to parent ([base class]Certificati...
asked 1 month ago
-1 votes
0 replies
Change a method in a parent class from the child class
I would like to change a method in a parent class from the child class. Example: class parent: def a(self): self.b() def b(...
asked 1 month ago
-2 votes
1 replies
Do inherited getter methods need to be overridden? [closed]
I'm wondering if you make a subclass with fields of the same name as the parent class, do getter methods invoked on the subclass object access it...
asked 1 month ago
0 votes
2 replies
Private method defined in `Sub` and `Super`, both methods can be invoked on Object of Sub , then why private method said not being inherited?
As per Oracle Tutorials A subclass does not inherit the private members of its parent class. However, if the superclass has public or protec...
asked 1 month ago
-2 votes
2 replies
Class inheritance in a python
Hello my practice question states Create a YPSurvey class in its own file, that extends the Survey class. Here is the header for the construc...
asked 1 month ago
0 votes
1 replies
How to use abstract class' children instances through methods?
I have an abstract class Player and its children AI and Human. In my main, when I create two objects Human and AI it works fine. But once I use t...
asked 1 month ago
0 votes
1 replies
Can a child class respond to events captured by its super?
I have a custom class which I am extending for various purposes, and the following code is working just fine: class Inator { constructor(whi...
1 votes
0 replies
How to avoid base class redefinitions when using Cython to expose C++ classes with inheritance to Python [duplicate]
I am currently programming a program which searches song according to diffrent parameters. In my system there are 2 types of songs: lyric and in...
1 votes
3 replies
Parent method using a variable defined in a child class
In Python you can do: class Binance(Exchange): name = "Binance" code = "binance" and in the parent class have class Exchange: @cl...
asked 1 month ago
0 votes
0 replies
C++ Undefined reference to template class [duplicate]
This question already has an answer here: Why can templates only be implemented in the header file?...
0 votes
1 replies
How to call parent function from descedant object? [duplicate]
This question already has an answer here: What is the 'new' keyword in JavaScript?...
asked 1 month ago
0 votes
0 replies
Mapstruct expression mappings using multiple source parameters
I am trying to map two fields to a single object, where the relevant fields are list objects and the said object cannot be changed. @Mapping(tar...
asked 1 month ago
-1 votes
0 replies
Ho to pass value to base class constructor by derived class constructor?
I have a problem with some code. Basically the problem request to build a class Employee that acquire some data and store them in a file, startin...
asked 1 month ago
0 votes
1 replies
How can I resolve this redundancy caused by inheritance and nested class?
I have 2 derived classes, in one of these classes I want to customize the implementation of a nested class that is in the base. In the other, I j...
asked 1 month ago
1 votes
4 replies
Can i know in the parent Form if an inherited Form has subscribed to the Show event?
I have the following forms in my winforms framework FormBase (inherited from Form) FormBaseList (inherited from FormBase) FormBaseDetail (inher...