E037 Uninitialized Constant Object
[Previous]  [Next] 
|
User Manual [Previous]  [Next] E037 Uninitialized Constant ObjectUmple semantic error generated when an Object constant is not initializedIt makes little sense to have a constant unless it is given a value. Since there is no obvious default value for arbitrary data types, it is an error to declare an uninitialized constant unless it is of one of the builtin Umple data types. (For builtin datatypes this is not a problem since a number can be initialized as zero by default, and a string as empty by default). Example// This example generates error 37 class X { const Y A; } class Y { Integer a; } Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears// This example resolves error 37 class X { const Y A=new Y(3); } class Y { Integer a; } Load the above code into UmpleOnline |