Sunday, January 8, 2017

How to declare an Array in Salesforce

An Array is nothing but collection of similar type of data.So we can refer an array is nothing but a list in salesforce. In this example I will show you how to declare an array in salesforce.

Sample declarations

Array without any size:

String[] paramList = new String[]{};
            is similar to
List<String> paramList  = new List<String>();
                   or
String[] paramList  = new List<String>();

Array with size:

String[] paramList = new String[8];

Thanks for visiting..hope this helps you!

No comments:

Post a Comment