Skip to main content

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.

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 ...
user25336866's user avatar
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 ...
Maurizio Del Magno's user avatar
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 "...
Doh Kun Lee sanity's user avatar
-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 ...
Smoker's user avatar
  • 1
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 ...
Aayla Secura's user avatar
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 ...
varun's user avatar
  • 1
-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 ...
rxvxl's user avatar
  • 1
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 ? ...
Sijo Kurien's user avatar
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 {})....
Bartosz Gościński's user avatar
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 ...
Mejenborg's user avatar
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 ...
jaheraho's user avatar
  • 510
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; }; ...
mada's user avatar
  • 1,932
-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 ...
תומר ש's user avatar
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 ):...
Pipo's user avatar
  • 4,963
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 ...
n3wbie's user avatar
  • 1,126

15 30 50 per page