function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MrithulaMrithula 

what is list ?

hi,

 

iam a  newbie..can anyone explain me " what is List  with an example? " and "Where should i use this ?"

 

Thanks in advance..

thatheraherethatherahere

Do you know about Array?

MrithulaMrithula

ya i know array in general..

Vinit_KumarVinit_Kumar

Mrithula,

 

Please go through the below link as to know about Lists:-

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections_lists.htm

thatheraherethatherahere

 

ohk, that's great.
Lists are just like arrays, but the main deference between them is that lists are dynamic in their size. Means we can add any number of elements to the list whenever we require but with array - we have an fix number of elements.
If you are familiar with Java collection, have a look here -

http://docs.oracle.com/javase/1.4.2/docs/api/java/util/List.html

here you will get all information about list and its functions.

After this write some programs then you will get what you want.

 

avijchakavijchak

List are just like array collection of homogeneous object.

 

like list of string or lost of integer. the mose common use of list is in return of SOQl .

 

Capgemini developer

PragPrag

Hi,

 

   In common, List is nothing but list of items.

 

     Eg: "List of works to be done in office"  - 1.sending mail, 2.organising a meeting, 3.to complete requirement docs,. etc. All these are list of items to be takencare in office. 

 

  As like the same, let me consider Office as a custom object and we have to take all list of items(fields) in single memory space. This can be implemented by LIST function.

 

general syntax:(using office as custom object):

 

List <office__C> items = new list<office__C>();

 

Here 'Items' is the memory space for the values to be assigned.

 

Think this may be a down to earth explanation. If you want still more explanation let us know.

 

Have a Nice start in Apex!

 

thanks