News

When default methods were introduced in Java 8, some developers thought they would be the same as abstract classes. That’s not true, however, because interfaces can’t have state.
Readers have returned quite a bit of feedback concerning, “Abstract Classes Vs. Interfaces” from April 2001. A recurring request asks to see a complete example of using interfaces and abstract ...
Basically ComponentA depends on ComponentB. To enable unit-testing class ComponentAImpl, the implementation of interface ComponentB must be injected into ComponentAImpl. The Java code below shows the ...