Inexperienced OO programmers often implement the following class hierarchy, where a Stack class is defined to be a subclass of List:
CLASS List { data: array [1..100] of INTEGER; count: INTEGER:= 0;METHODS insert (pos: 1..100; value: INTEGER); require: insert value into List at position pos delete (pos: 1..100) ensure: remove value stored at position pos from List retrieve (pos: 1..100),: INTEGER; ensure: return value stored at position pos in List}CLASS Stack EXTENDS List {METHODS push(value: INTEGER) ensure: append value to end of Stackpop(): INTEGER; ensure: remove and return value from end of Stack}Explain why this is a bad use of inheritance.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.