New (Arraylist constructor)

From m204wiki
Revision as of 21:07, 4 January 2011 by 198.242.244.47 (talk) (Created page with "<span style="font-size:120%; color:black"><b><section begin=dpl_desc/>Create new Arraylist instance<section end=dpl_desc/></b></span> [[Category:Arraylist methods|New constructor...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<section begin=dpl_desc/>Create new Arraylist instance<section end=dpl_desc/>

New is a member of the Arraylist class.

This method returns a new instance of an Arraylist.

Syntax

  %arrayl = New

Syntax Terms

%arrayl
An Arraylist object that is set to a new Arraylist object reference.

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