What does “contract” of a class mean

后端 未结 8 1577
再見小時候
再見小時候 2020-12-05 04:18

I am reading the book The Java Programming Language. In the chapter which explains overriding method, it says:

Making an override met

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 05:02

    A class's "Contract" is it's public interface or at least the interface if presents to classes other than itself.

    This means that it includes any elements (methods, fields, constructors, etc.) that other classes can use.

提交回复
热议问题