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
china.leafchina.leaf 

I have a question about "List"

A : List<Account> flstAccount = new List<Account>([select id from account]);
B: List<Account> flstAccount = [select id from account];

 What is the difference between A and B?

thank you.


Message Edited by china.leaf on 01-12-2009 11:24 PM
Praetorian65Praetorian65
The end result is the same. Im not sure how apex works exactly, but I would assume that the first one creates a new list from a list which is the result of the query. This would make it less efficient that the second example which just sets the list variable to the result of the query.


Message Edited by Praetorian65 on 01-13-2009 09:26 AM