Question: Question 1. The target interface is for a simple set of int: public interface Intset { boolean addToSet(int e); // adds e to the set

 Question 1. The target interface is for a simple set ofint: public interface Intset \{ boolean addToSet(int e); // adds e to

Question 1. The target interface is for a simple set of int: public interface Intset \{ boolean addToSet(int e); // adds e to the set if it is NoT already in the set. // returns true if e is added, false if e was already in the set. boolean deleteFromset(int e); // removes e from the set if it is in the set. // returns true if e was in the set, false if e is not in the set. boolean setContains(int e); // returns true if e is in the set, false if not. int sizeofset(); // the number of elements in the set. Complete the 4 methods of the following class adapter Here is a tester. public class IntSetTest \{ public static void main(String[] args) \{ IntSet set = new IntSetImpl (); System.out.println (set.addToset (1)); System.out.println (set.addToset (2)); System.out.println (set.addToset (2)); System.out.println (set.addToset (3)); System.out.println(set.sizeofset()); System.out.println (set. setContains (2)); System.out.println (set. deleteFromset (2)); System.out.println (set.setContains (2)); System.out.println (set. deleteFromset (2)); System.out.println(set.sizeofset())

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!