Why is the constructor of the StackLinkedList class empty?

Skill/Topic: Stacks using Linked List
A) The constructor of the StackLinkedList class is empty because the constructor of the LinkedList class is called when an instance of the StackLinkedList class is declared. The constructor of the LinkedList class initializes the node and attributes that are

Showing Answers 1 - 1 of 1 Answers

The constructor is empty because the constructor of the LinkedList class is called before the constructor of the StackLinkedList class,we know that the StackLinkedList class inherits the LinkedList class. The LinkedList class constructor initializes the front and back pointers of the linked list to NULL. Therefore, there is nothing else for the StackLinkedList class constructor to do and hence they are empty.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions