Question: // A mutable set of Numbers class NumberSet { // @effects makes a new empty NumberSet public NumberSet(); // @returns n ? this public boolean

// A mutable set of Numbers class NumberSet { // @effects makes a new empty NumberSet public NumberSet(); // @returns n ? this public boolean contains(Number n); // @modifies this // @effects thispost = thispre ? { n } public void add(Number n); } // A mutable set of Integers class IntegerSet { // @effects makes a new empty IntegerSet public IntegerSet(); // @requires n is an Integer // @returns n ? this public boolean contains(Number n); // @requires n is an Integer // @modifies this // @effects thispost = thispre ? { n } public void add(Number n); } Circle the correct statement. Explain your answer. a) NumberSet is a true subtype of IntegerSet b) IntegerSet is a true subtype of NumberSet c) Neither is a true subtype of the other

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!