list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

E006 Missing Default

Umple syntactic error reported when no default value is specified after an attribute that is marked defaulted

The keyword 'defaulted' means that the attribute will be given a default value if the value is not set in the constructor. Omitting the default value is therefore illogical. The default value is specified after an equals sign.

Example

// This example generates the error message
class X {
  defaulted Integer a;
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// The following shows how to avoid the error
class X {
  defaulted Integer a = 5;
}
      

Load the above code into UmpleOnline