Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA Need help with remove and contains. If you need me to post two different questions let me know. and can you glance at add
JAVA Need help with remove and contains. If you need me to post two different questions let me know. and can you glance at add for me?
You must write 4methods of the Sortedset class (a) The add nethod This method hss the following signature boolesn add(T item): The method is meant to store an iten in the set, provided thst another equivslent iten is not slresdy in the set. The add method should return true to indicste that no equivalent iten lias already in the set, and that therefore the new iten was added. The method should return false othervise. (b) The remove method This method is mesnt to remove an iten from Sortedset. Its signstune is: boolesn remove(T iten) The method should retunn true if on object is removed fron the Sortedset (in other words, the set had sn object equivslent to item), or false otherwise. (c) The tostring method As with other classes, this method should return String representing the Sortedset object. In this case, the String should reflect what itens are in the set. For example: SortedsetStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started