+ Start a Discussion

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
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