Java, Spring, Microservices, Interview, Coding.
implemented in HashSet class. public boolean remove(Object o) { return map.remove(o)==PRESENT; } Here note that remove(Object key) method of the HashMap returns the Value associated with the key. Whereas the remove(Object o) method of the HashSet returns Boolean value. Also we know that for every