What does “implements” do on a class?

前端 未结 7 800
抹茶落季
抹茶落季 2020-12-22 18:51

If a class implements another class... what does that mean? I found this code sample: http://www.java2s.com/Code/Php/Class/extendsandimplement.htm

But unfortunately

7条回答
  •  自闭症患者
    2020-12-22 19:06

    An interface can be thought of as just a list of method definitions (without any body). If a class wants to implement and interface, it is entering into a contract, saying that it will provide an implementation for all of the methods listed in the interface. For more information, see http://download.oracle.com/javase/tutorial/java/concepts/

提交回复
热议问题