The java code I'm working on at the moment has often a structure like

file Controller.java:

interface Controller {...}

file ControllerImpl.java:

class ControllerImpl implements Controller {...}

But for every interface there is only one implementation. Isn't that the same as using header files in C/C++ where I have the code split into files like

Controller.hpp
Controller.cpp

From what I know, header files in C/C++ have been introduced to help the compiler, which is not necessary anymore in Java. Also header files should help with the readability of the code, but having a modern IDE with folding and outline view this is also not a necessity anymore.

So why do people again introduce header files in Java through the back door by programming against interfaces?

Edit
Report