Questions tagged [abstract]
abstract is a keyword shared by a multitude of object-oriented programming languages. Methods and classes can be marked abstract to indicate that they do not contain the full implementation of application logic and have to be extended. Abstract classes can not be instantiated and serve the purpose of providing a uniform interface for their subclasses, as well as the implementation of common methods that don't have to be reimplemented for each subclass.
abstract
2,541
questions
-1
votes
1
answer
53
views
Does an abstract class get instantiated by its subclass? [duplicate]
While you cannot make an instance of an abstract class, in this example the super keyword is used to reference the instance variable of the super class, hence a reference that is provided in the ...
-1
votes
3
answers
123
views
Are all abstract classes parent classes? [closed]
I started learning Java few months ago. I am wondering if all abstract classes are parent classes. An abstract method in an abstract class won’t have a body. So the abstract method it must be ...
0
votes
1
answer
21
views
change detection of variables declared in the extended class in angular 14 applicaiton
I'm looking for the best approach to detect changes in properties declared in extended classes in Angular. These changes are not detected by ngOnChanges because they're not inputs.
I've currently ...
1
vote
1
answer
71
views
Combination of abstract classes and generics problem when declaring and instantiating
I am struggling with an app in C# that is a document review app that searches documents for a list of search terms. It needs to either take a PDF or WORD document and possibly others in the future.
I ...
0
votes
3
answers
87
views
How can I call abstract static methods through an interface?
I am looking for a better way than reflection to call static methods on a bunch of classes.
Consider that I have a factory that is seeded as such:
private static IReadOnlyDictionary<string, Type>...
0
votes
1
answer
69
views
Extract abstract from PubMed using BioPython and writing to CSV
I am quite new to Python, and would like to extract abstracts from pubmed using the bio entrez package. I can get abstract based on a given ID list and write into csv.
My code is:
papers = ...
0
votes
1
answer
64
views
How can I get an object of a given type to be returned from HttpClient.get when requesting an abstract object?
I have an abstract class:
export abstract class DataEntry {
...
public abstract clone(): DataEntry;
}
and an actual class extending it:
export class Record extends DataEntry {
...
public ...
0
votes
1
answer
93
views
MapStruct maps the model's field as empty when the field is of an abstract type
I have a class that has a field which in turn is an abstract class. I would like MapStruct to be able to map from the incoming DTO to the internal model including all the subfields of the abstract ...
-2
votes
1
answer
60
views
How to not inherit all variables and methods of an abstract class but only some, in C#? [duplicate]
I have a C# abstract class:
public abstract class BaseScript : MonoBehaviour
{
public float numberOne = 5f;
public float numberTwo = 10f;
public float result;
public void NumbersAdd()
...
0
votes
1
answer
85
views
How do I specify an abstract syntax of different language constructs in an already existing language?
I'm trying to solve a problem of specifying an abstract syntax of different language constructs such as variable declaration, array declaration, if-else statements and so on in Haskell, but I'm ...
-1
votes
1
answer
93
views
In C#, if all interface members are public and abstract by default, why can't we use override in implementing class? [duplicate]
In C#, if all interface members are public and abstract by default, why can't we use override in implementing class? While we can use override in abstract classes.
interface IExample
{
int Ara();
}...
0
votes
0
answers
67
views
java se 8 rules for implementing abstract methods from extended interfaces
why does this code compile printing "Class 2" (java se8; eclipse) even if abstract method is NOT implemented in first concrete class?
IDE gives me the hint: The type Class1 must implement ...
0
votes
2
answers
79
views
How to keep external references to abstract generic class abstract and generic?
I am trying to do something like the following -
public abstract class Utility<A, B>
{
// Return values cannot be cached in class-scoped fields as these need to be invoked by threaded ...
0
votes
0
answers
52
views
java.lang.IllegalArgumentException: None of [] allows for delegation from cle.application.page.applicationui.BasePage.isDisplayed()
Caused by: java.lang.IllegalArgumentException: None of \[public static java.lang.Object net.thucydides.core.steps.ProxyConfiguration$InterceptorDispatcher.intercept(java.lang.Object,java.lang.reflect....
1
vote
2
answers
65
views
Instantiate class from a collection of subclasses, while maintaining access to static members in Typescript
I think I may have stumbled into a situation where what I want is best described by having both static and abstract on a member of an abstract class, but that doesn't seem to be possible in typescript....