What is an Attribute

Attribute: It is a particular usage of an instance variable. The set of attribute values held in a specific instance of a class state the current state of that instance. A class definition might impose specific constraints on the valid states of its instances by needing that a particular attribute, or set of attributes, do not take on specific values. For example, attributes holding coursework marks for a class must not hold negative values. The attributes must be manipulated by the mutator and accessor methods.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.