“Standard simple” interfaces in Java?
问题 So here in Java I've written a typical class, to send json to a rest server. (I'll include the whole class below for clarity.) So that's a file "Fetcher.java" Now for the callback you need an interface. The interface is trivial, just one function with a string. public interface FetcherInterface { public void fetcherDone(String result); } Annoyingly you need a whole file for that, "FetcherInterface.java" So this interface is nothing but "one callback with a string". Often all you need is just