Don’t assign static references to instance method calls in Java

Photo by Luca Bravo on Unsplash

Assigning a static reference to an instance method call could be perilous. Let’s take a look at an example Java class to examine why:

Seems pretty innocuous in itself, but ostensibly we’re just assigning static reference in Foo