Questions tagged [inheritance]
Inheritance is the system in object oriented programming that allows objects to support operations defined by anterior types without having to provide their own definition. It is the major vector for polymorphism in object-oriented programming.
inheritance
42,733
questions
1
vote
0
answers
30
views
how to use a foreingkey field in a Multi-table inheritance?
Currently the code is working for me, however in admin panel it is not displaying the information in the fields. I assumed that the information that had been entered in the parent table would be seen ...
0
votes
1
answer
46
views
"Error creating form in Unit...fmx: FMX datamodules not supported." when inherit from TDataModule descendant class
I have a problem (with sample project).
I have a TDataModule derived class to which I have added some properties and methods.
I wanted to make sure that it was possible to create a new instance of ...
3
votes
1
answer
49
views
Multiple constructors annotated with Lombok @Builder cause a problem?
This is my first question, so please feel free to correct anything that I missed writing this question:)
I am having trouble with using the @Bulider with my DTO objects.
I have an abstract class "...
-2
votes
0
answers
55
views
a constructer declared in a type with parametere list must have 'this' constructor inisializer error [closed]
I'm working on a C# project where I have an abstract base class Employee with a parameterized constructor Employee(string name). My derived class FullTimeEmployee has a constructor that takes three ...
0
votes
1
answer
34
views
Why is inheritance using constructor functions "hard to do properly" (MDN)?
The MDN's article for "Inheritance and the prototype chain", under "Different ways of creating and mutating prototype chains": "With constructor functions", gives the ...
0
votes
0
answers
44
views
How to alter WPF button color from the Code not user input (click) [closed]
I have a WPF application that allows users to pick a test to run. We have 3 tests called Test1, Test2 and Test3. All these tests inherit a model called TestModel. TestMoel contains common properties ...
-1
votes
0
answers
32
views
Polymorphism in Java Spring [closed]
I develop an application in Java Spring. I have an abstract superclass called AbstractPuzzle and I have its children called Wordle and Riddle(I have JOINED type of inheritance).
I get an ...
2
votes
0
answers
66
views
Base class not recoginsed while using wild card generic
Why is the below not working?
A b1 = new B();
Function<? super B, ? extends A> function = x -> new B();
A apply = function.apply(b1);
It gives an error "Required type capture of ? ...
3
votes
1
answer
69
views
Why objects having instance of a class with private property in prototype throw when accessing private member?
Consider this code:
class Klass {
#priv = 42
get pub() {
return this.#priv
}
}
// these two correctly return 42
console.log(new Klass().pub);
console.log((new class extends Klass {})....
1
vote
0
answers
29
views
Complex multi level EF Core 8 inheritance issue
Please consider the following:
DB Context:
// DbContext.cs
public partial class OperationsDbContext : DbContext
{
public virtual DbSet<AnimalBase> AnimalBases { get; set; }
public virtual ...
1
vote
2
answers
37
views
Angular component inheritance: will @Component decorator metadata inherited?
I have a parent-component like this:
@Component({
template: "",
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ImYourFather {}
Now I also have two inheritance ...
5
votes
3
answers
170
views
Initialization order of inherited constructors
I have this example:
#include <iostream>
#define print(X) std::cout << X << std::endl
struct B1 {
B1(int _i = 5): i(_i) { print("B1 constructor"); };
int i;
};
...
-2
votes
2
answers
67
views
How do I create a member that can accept 2 very similar interfaces?
I currently have two classes that do exactly the same but have differences of a single member.
interface interfaceA {
VariationA getVariation();
}
interface interfaceB {
VariationB ...
0
votes
0
answers
21
views
OpenAPI Swagger with kotlin inheritence
How to deal with inheritence with Kotlin for Swagger targetted objects?
Just wondering if there is a way to do something like
@Schema(description = "Child.")
class Child(
aName: String
):...
0
votes
1
answer
43
views
inherit constructor and factory in flutter
I'm learning flutter and I'm trying to turn requests results into more convenient objects, so I created the basic schema of a response (which is not supposed to be instantiated anytime) :
class ...