Declaring NULL capable variables [message #903930] |
Mon, 27 August 2012 06:59  |
Eclipse User |
|
|
|
When defining a simple value variable I know how to define the field as NULL capable, such as the following, and understand that by default the field will contain a NULL value.
myInt int?;
myString string?;
But how do I declare an array as being NULL capable?
I tried all of the following and they all appear to be valid but I don't understand the difference.
myIntArray1 int[]?;
myIntArray2 int?[];
myIntArray3 int?[]?;
As a side note the section within code snippets, on the EDT:Declaring data page, I think there's a typo; the second example in the Values of type List isn't correct. Once I know the answer (to the above question) I can update it.
Richard
|
|
|
Re: Declaring NULL capable variables [message #903954 is a reply to message #903930] |
Mon, 27 August 2012 08:41  |
Eclipse User |
|
|
|
Hi Richard,
Here's an explanation of each array type:
myIntArray0 int[];
The array field cannot be null, and elements in the array cannot be null.
myIntArray1 int[]?;
The array field can be null, but elements in the array cannot be null.
myIntArray2 int?[];
The array field cannot be null, but elements in the array can be null.
myIntArray3 int?[]?;
The array field can be null, and elements in the array can be null.
You are correct about the snippet being wrong, it should be "nullVals Int?[];"
Hope this clears things up.
-Justin
|
|
|
Powered by
FUDForum. Page generated in 0.03605 seconds