Question: In Java , wirte a method called deleteExtra that will recive a T parameter and will delete all but one occurence of the parameter .
In Java , wirte a method called deleteExtra that will recive a T parameter and will delete all but one occurence of the parameter . For example if the parameter is 24 and the list has 9 occurences of 24 the method will delete 8 of them , note that if the list has only one occurence , do not delete it; if the list is empty , print an error message that reads " cannot delete - list empty " . all work should be done by the method , i.e do not call searchItem or deleteItem.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
