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 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. 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.

The exact meaning of abstract depends on the programming languages in question, some of them being: Java, C#, php, C++, Delphi Pascal. Similar logic can also be implemented using different keywords in other languages ( for example, Oracle PL/SQL allows to create abstract classes and methods by declaring them NOT FINAL)

The power of abstract methods and classes is widely used by design patterns.

2521 questions
0
votes
1 answer

Contract "ItemMint" should be marked as abstract

code trying to create contract using KIP37 as base contract. its works fine for the previous version of @klaytn/contracts - 0.9.0, but it is not working for @klaytn/contracts - 1.0.0 //SPDX-License-Identifier: Unlincesed pragma solidity…
0
votes
0 answers

How to distinguish Interfaces and Abstract Classes in C++?

I'm trying to learn differences between Interfaces and Abstract Classes in C++. I've been studied from a lot of source. I can definitely define what is the interface and what is the abstract class. But i just know as definitional. When i look to the…
jasonsmask
  • 47
  • 1
  • 9
0
votes
0 answers

How to insert implementation of abstract type as generic parameter

EDIT 1 : Changing overloaded MemoryPersistency constructor to explicitly expect an XmlParser solves the issue : public MemoryPersistency(IDictionary objectsMap, IDiskPersistency>, IDictionary, string>…
0
votes
1 answer

In Python how can I overwrite the class attribute of an inherited class, where that attribute is itself an instance of a model?

As in the title, I have a base class ListView, with a Serializer attribute that needs overwriting. For each of my django models I create a child ListView class and a Serializer. So for example for the django model Event we have a corresponding view…
0
votes
1 answer

Typescript - Trying to call method on abstract base with derived type as parameter

The abstract base has a method that takes a base/derived and performs something on it. Seems like I'm missing something with the typing, trying to find out what. Attempt 1: abstract class Base { protected runFuncOnThis = (func: (baseOrDerived:…
Tsury
  • 729
  • 1
  • 9
  • 24
0
votes
1 answer

Making abstract an overridden method

Here's something I quite understand: abstract class A { public void foo() { System.out.println("a"); } } abstract class B extends A { @Override public abstract void foo(); public void bar() { super.foo(); …
lumin0u
  • 24
  • 4
0
votes
3 answers

Populating a field that has no setter in abstract class

I'm working with a class EventRecordWrittenEventArgs in my unit test(s): public sealed class EventRecordWrittenEventArgs : EventArgs { public EventRecord EventRecord {get;} public Exception EventException {get;} } I would like to populate the…
Isaac Perez
  • 570
  • 2
  • 15
  • 31
0
votes
2 answers

How to inherent from a class that is already inherited from AbstractBaseUser in Django

I am trying to make an inheritance from a User class that is already inherited from the AbstractBaseUser but I am receiving an error that is telling me AUTH_USER_MODEL refers to model 'authentication.User' that has not been installed and I am sure I…
0
votes
0 answers

Why getting the length of a list gives an error?

I have an abstract class called Product and two classes (RestaurantProducts , ClothesProducts) extending from the abstract class. I want to create a grid of RestaurantProducts and a grid of clothesProducts. I created a List of RestaurantProducts and…
Mary
  • 51
  • 3
0
votes
1 answer

Why do we need abstract classes when we can use interfaces in C#?

From what I understand, an abstract class provides a framework of members with no body and enables its subclasses to each implements its own members. But a class cannot inherit from more than one base class and an interface solves that problem by…
0
votes
1 answer

Abstract method inside abstract constructor

I was wondering why can't i create something like this ? : class Abstract_object { protected: virtual void _initialize() = 0; public: Abstract_object() { _initialize(); } }; class Object : public…
Hyarius
  • 1
  • 1
0
votes
0 answers

Parsing PDF to extract Abstract

I'm trying to get a python script that allows me to automatically retrieve an abstract from any PDF, as long as it contains one. Some people would have an idea how to write an automated python script already, requiring only the input file, that…
lbarbeau
  • 1
  • 1
0
votes
1 answer

Solidity Ide- interface error: Contract "Cat" should be marked as abstract

I'm new with Solidity, and used version 0.8.7 ! I'm practice abstract contract and interface but get this error : Contract "Cat" should be marked as abstract. And here it's my code below. //SPDX-License-Identifier: MIT pragma solidity…
0
votes
1 answer

How do I organize these methods in a neat way without having to manage class instances?

I have a Java class called Program whose rough skeleton is like this: public class Program { public Program(AST ast){ ... new RewriteRule1().rewriteAll(); new RewriteRule2().rewriteAll(); } interface…
0
votes
1 answer

How to iterate through a set in a constraint?

I would like to iterate through a set in a constraint. I have built an abstract model. Let's assume the following dictionaries for the instance: dict_Nodes = {None: ['N1', 'N2']} dict_Nodes_ArcsOut = {'N1': ['N1N4', 'N1N3'], 'N2': ['N2N5',…
MaxImal
  • 13
  • 7