Showing posts with label Arrays. Show all posts
Showing posts with label Arrays. Show all posts

Sunday, 9 July 2017

Arrays in Salesforce Apex

Arrays in Salesforce Apex 

Array: 

Array is a collection of similar elements, where the memory allocated sequently. 

Data type [] array name = New data type (size); 

// this is called dynamic declaration   

Data type [] array name = New data type [] {value; value 2};

// static declaration 

         Integer [] marks = new integer [] {10,20,30}; 
         Account a1 = new account (name=’same’);
         Account a2 = new account (name=’ram’); 
         Account [] acc = new account [] {a1, a2}; 
         String [] s1 = new string [] {‘ram’, ‘Sam’, ‘ram’};
        String [] s1 new string [4]; 
            S1[0] = ‘Kumar’; 
            S1 [1] = ‘Ravi’; 

Collections in Saleforce with Examples

Collections in Saleforce with Examples 

1. Arrays 
2. Program to display array of records in page block table 
3. Program to create picklist field in VF page using arrays in Apex.
4. Difference between Array & collection   
5. List introduction 
6. Methods in the List 
7. Program to demonstrate usage of list in apex 
8. Example programs using List, Apex & visual force
9. Set introduction 
10. Methods in set 
11. Program demonstrate usage of set in apex. 
12. Example programming using set, Apex & visual force.
13. Map introduction 
14. List of Methods in Map 
15. Program to Demonstrate usage of Map in Apex  
16. Example programs using Map, Apex & visual force    

17. Example to create Dynamic Pick list using collections.