I was asked recently, the following
Given the following interface, write a class that will leak memory every time Processor#doSomething(String) is called and explain why it does so.
public interface Processor {
void doSomething(String msg);
}
I am not sure there is memory leak in Java in the same sense as C/C++. What is the significance of an interface here.
Also, I have never seen a # used to call a method.
Can someone explain this to me? Thanks