What does “contract” of a class mean

后端 未结 8 1512
再見小時候
再見小時候 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:18

    There is many principles that you should conform to when programming in java, or in any programming languages. The principles depend on the programming language you are using. You can know more about contract in Design by contract wikipedia page

    0 讨论(0)
  • 2020-12-05 05:19

    It means that method overriding a method on a parent class or interface must behave in the way that the contract defines.

    Otherwise the result is undefined.

    0 讨论(0)
提交回复
热议问题