An Example of Dynamic Dispatching in Object-Oriented Systems

soul of a nameless bard
2 min readApr 10, 2021

Say we have a class called InstrumentedHashSet that extends the HashSet class from Java’s Collection library.

import java.util.Collection;
import java.util.HashSet;
public class InstrumentedHashSet<E> extends HashSet<E> {

Now, let’s add a private instance variable called addCount along with an empty…

--

--

soul of a nameless bard

Research and reflections on various topics in systems and software/hardware engineering, design, biology, consciousness, metaphysics and spirituality