Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9025993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:24:45+00:00 2026-06-16T06:24:45+00:00

I have an abstract class, which i’m inheriting from. To make it clear- I

  • 0

I have an abstract class, which i’m inheriting from.
To make it clear- I implemented all of the abstract methods in the inheritor.

After done using the object made from the inheritor class, im trying to destruct it, but instead of calling the inherited destructor it sends me to the abstract method.

in my programm it look like this

class LinkedHash {

private:
      LinkedHashEntry **table;
      int max_size;
public:
      /* Creates a hashtable of size maxSize*/
      LinkedHash(int);
      LinkedHash(){}       
      /* deletes all members of the hashtable */
      virtual ~LinkedHash();

      virtual int hashFunction(int key) = 0;

      void insert(int key, Process* value);

      void remove(int  key);
      int getMaxSize(){return max_size;}
      LinkedHashEntry* search(int x);
};

class LinkedHashinheritor: public LinkedHash {

    public:
        LinkedHashinheritor():LinkedHash(1000){}
        int hashFunction(int key);
};

this is my cpp file relevant code:

int LinkedHashinheritor::hashFunction(int key)
{
    return key%1000;
}

and there are the calling for constructor and destructor for the relevant object:

   Scheduler::Scheduler()
{tmp_lh=new LinkedHashinheritor();}

Scheduler::~Scheduler()
{
    delete tmp_lh;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:24:46+00:00Added an answer on June 16, 2026 at 6:24 am

    To make this clear upfront: Making a class abstract does not prevent its destroctor from being called. The destructors of all classes in an inheritance hierarchy will always be called (in the order from derived class to base class).

    As you have not declared a destructor in your derived class, and the compiler-provided one is extremely trivial (as in, it only has to call the destructor from the base class), it is very well possible that the compiler has optimised the derived destructor away.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a abstract class which has some common methods for all of my
I have two classes (MVC view model) which inherits from one abstract base class.
Suppose I have abstract class A and abstract class B which inherits from A,
I have an abstract class ClassA which derives from ViewGroup . I would like
I have a BaseEntity abstract class which is a super class for all my
I have a abstract class called Customer which has some attributes shared amongst all
I have an abstract class which calls one of its abstract methods, as so:
I have this super class which extends from another class public abstract class AbstractDOEMessageFinderAction
I have an abstract base class from which many classes are derived. I want
I have abstract class A, from which I inherit a number of classes. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.