Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
0 answers
37 views

i know that we can not write code or return something inside a method in abstract class (well becuse its abstracted!) what about variables inside of abstract class ? can i for example define a 'x' ...
Human's user avatar
  • 27
4 votes
2 answers
130 views

I have an abstract base class that used to accept a service via constructor injection: export abstract class BaseEditEventClass<T> extends BaseFormClass { constructor(protected _service: ...
Raphaël Balet's user avatar
0 votes
1 answer
89 views

This question is likely already asked, but I am not satisfied with the answers. I add the link for reference. Previous Question Now, coming to the point, I have six different abstract classes which ...
Aadhil Ahamed's user avatar
3 votes
1 answer
740 views

I'm having trouble implementing a threaded Binary Search Tree in C++. I have a non-threaded tree completely implemented (see below code). What I'm having difficulty with is setting the threads to ...
Boom's user avatar
  • 512
1 vote
0 answers
104 views

In my class, I have some methods that can be overridden by subclasses, but do not need to be. I like to test my project and generate a coverage report using coverage.py. Because the method of the ...
502E532E's user avatar
  • 581
3 votes
5 answers
219 views

I have classes ProgramA and ProgramB that derive from abstract class Program. I sum them up into an array std::vector<Program*> and I pick a random one from there that runs for awhile. #include &...
Awed2's user avatar
  • 71
1 vote
4 answers
158 views

Let's say I have the following classes: public abstract class Animal { public abstract void talk(); } class Dog extends Animal { @Override public void talk() { System.out.println(&...
montag's user avatar
  • 11
1 vote
1 answer
44 views

I implemented the classes UtilityElectricityConsumptionModel and UtilityNaturalGasConsumptionModel from the abstract class UtilityConsumptionModel. The UtilityNaturalGasConsumptionModel just has the ...
Ludovic Wagner's user avatar
-1 votes
2 answers
113 views

In the past life was easy, interfaces could not have implementations, abstract classes could. Nowadays (like for 5+ years already lol), the only difference between abstract class and interface in C# ...
sjanisz's user avatar
  • 162
0 votes
1 answer
61 views

I am a beginner in Python coding and I try to learn abstract classes. I have a problem with implementing two exams which extend abstract class Exam, defining contract for diagnostic test. class Person:...
Mark's user avatar
  • 3
0 votes
1 answer
84 views

Using c++20, I have the following idea to generalize access to multiple chips in a circuit: An interface should allow reading/writing to all chips with different address bits and register sizes (8, 16,...
DEKKER's user avatar
  • 933
1 vote
1 answer
63 views

I have a Parent Class Parent class Parent{ public String calculate(String input){ // does lots of external system calls and complex calculations } } Then I have an ...
Rajib Sharma's user avatar
-1 votes
1 answer
75 views

I have the following structure: class grandparent(ABC): @abstractmethod def get_obj(self): pass class ParentBase(grandparent): def __init__(self, obj1): self.obj1 = obj1 ...
Rezzy138's user avatar
0 votes
0 answers
311 views

I want to force all subclasses of a class to implement a property. As I understand it, I have to use abc methods for this use case. I tried the following: from abc import ABC, abstractmethod class ...
PascalIv's user avatar
  • 625
0 votes
1 answer
85 views

I am trying to develop a routine that will run an sql statement and use the results to populate class objects that are derived from an abstract class, something like the following: public static List&...
Richard B. Sorensen's user avatar
-5 votes
2 answers
118 views

I'm trying to use an abstract class as variable type in C# and getting System.StackOverflowException: 'Exception_WasThrown' error when try to read ResultData.ValuesDescription public abstract class ...
DPZ's user avatar
  • 153
1 vote
3 answers
153 views

If I create an abstract class in python using abc with an abstractmethod as follows and create a concrete class which doesn't use def to override the abstractmethod but instead attempt to set the ...
Lim Jing's user avatar
2 votes
2 answers
69 views

I'm trying to get abstract properties to work, enforcing property getter & setter definitions in downstream classes. from abc import ABC, abstractmethod class BaseABC(ABC): @property @...
Floriancitt's user avatar
0 votes
0 answers
18 views

I want to have something like class Parent { @mustBeOverridden func overrideThis(_ s: Source) -> Target { // does not do anything, i.e. it is "abstract" } } class Child1: ...
CocoaNut's user avatar
0 votes
2 answers
149 views

I want my abstract base class to have a templated constructor, but can't get it to work without an extra parameter to deduct the type from. I want to do something like this: class Base { public: ...
UniCode's user avatar
0 votes
1 answer
56 views

I have an abstract class, Float, that generates concrete subclasses dynamically. I would like to type-hint the return type so that the IDE knows that it's a concrete subtype of Float. That is, when ...
D. Estes McKnight's user avatar
0 votes
1 answer
124 views

Preface: Serialization libraries cannot be used due to restrictions in the development environment, and the latest version usable is C++ 11. I have various struct that need to be serialized and ...
cma0014's user avatar
  • 1,599
0 votes
1 answer
90 views

Let's say we have a game, characters in which have special abilities. All abilities share an abstract base type called AbstractAbility. Each character has a list of said base type (List), elements of ...
Who am I's user avatar
0 votes
4 answers
134 views

I have an abstract class like this : class Thing { public: Thing(); virtual ~Thing(); static QMutex s_mutex; virtual void load() = 0; virtual void translate() = 0; virtual ...
Charles's user avatar
  • 1,329
0 votes
1 answer
50 views

I have a quite a few DTOs like so: class AccountDTO extends AbstractNestedDTO { public function __construct( FirstNameDTO $firstName, LastNameDTO $lastName, BirthdayDTO $...
Viacheslav Ravdin's user avatar

1
2 3 4 5
107