Is programming against interfaces in Java the same concept as using header files in C/C++?

前端 未结 7 1362
失恋的感觉
失恋的感觉 2021-02-07 08:02

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

file Controller.java:

interface Controller {...}

file Controller

7条回答
  •  醉话见心
    2021-02-07 09:02

    Interfaces doesn't come from a desire to keep header files.

    Interfaces the closest Java comes to supporting http://en.wikipedia.org/wiki/Design_by_contract

提交回复
热议问题