Question: In Java: TheSimpleSetclass shall be written with Generics in order to allow Sets that can hold a variety of different data types Data Fields: TheSimpleSetclass
In Java: TheSimpleSetclass shall be written with Generics in order to allow Sets that can hold a variety of different data types
Data Fields:
TheSimpleSetclass shall have a private data field which is an array of 10 elements to store each element of the Set. This array will be fixed at 10 and WILL NOT resize itself. We are creating a very simple set to hold only 10 items.TheSimpleSetclass shall have a private data field that is an integer which holds the current size of the set. The size will increase as new items are added to the set.TheSimpleSetclass shall haveno other data fields.
Constructors:
TheSimpleSetclass shall have a no argument constructor to create a new, empty instance ofSimpleSet.TheSimpleSetclass shall have another constructor that will accept a comma separated list of items to initialize the set. The following would be two examples of invoking this constructor: SimpleSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
