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
Get step-by-step solutions from verified subject matter experts
