class invariant

原始詞典資料1 筆記錄

這個字我們還沒有寫成教學內容。以下是外部詞典記錄的用法,原文照列,方便你先看懂它的意思。

class invariantnoun

  • 1

    An invariant used to constrain objects of a class that is preserved by class methods and that constrains the state stored in the object.

    • Every object of a given class must satisfy the class's invariant. This invariant acts as a constraint, limiting the size of the class's state-space. A subclass both inherits the class invariant(s) of its superclass(es) and adds a further restriction of its own.

資料來源:英文維基詞典 English WiktionaryCC BY-SA 4.0)。 原文照列,未經改寫。