New (Arraylist constructor): Difference between revisions
Jump to navigation
Jump to search
m (→Syntax terms) |
m (→Syntax terms) |
||
Line 9: | Line 9: | ||
<td>An Arraylist object that is set to a new Arraylist object reference.</td></tr> | <td>An Arraylist object that is set to a new Arraylist object reference.</td></tr> | ||
<tr><th><var>%(Arraylist)</var></th> | <tr><th><var>%(Arraylist)</var></th> | ||
<td> | <td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. | ||
</table> | </table> | ||
Revision as of 22:09, 26 July 2011
Create a new Arraylist object (Arraylist class)
This method returns a new instance of an Arraylist.
Syntax
%al = [%(Arraylist Of itemType):]New
Syntax terms
%al | An Arraylist object that is set to a new Arraylist object reference. |
---|---|
%(Arraylist) | The optional class name in parentheses denotes a Constructor. |
Usage notes
- New is a constructor and as such can be called with no method
object, with an explicit class name, or with an object variable,
even if that object is null:
%arrayl = new %arrayl = %(Arraylist):new %arrayl = %arrayl:new
Note: When using the second of these syntax options of New, which explicitly indicates the class, both the collection and item datatypes must be specified just as they are on the collection variable's declaration:
%arrayl is collection Arraylist of longstring %arrayl = %(Arraylist of longstring):new