You need to sign in to do that
Don't have an account?
Siri Reddy 5
Instantiation
Hi,
Please help me know the difference between the below two :-
List<Account> accntList = new List<Account>(); ---- I'm creating an Instance.
List<account> accntList; ---- I'm just declaring a list variable.
Thanks and regards
Siri
Please help me know the difference between the below two :-
List<Account> accntList = new List<Account>(); ---- I'm creating an Instance.
List<account> accntList; ---- I'm just declaring a list variable.
Thanks and regards
Siri
the direct answer is
in the 1st case you are creating an instance of the object which will store the values of account object and you can refer the fields with the help of the instance but the 2nd case is just declaring list<Account> which will store the value of account type. you can not take the reference of the field .
Please let me know if it justifies your issue and mark it as a best answer
thanks
All Answers
the direct answer is
in the 1st case you are creating an instance of the object which will store the values of account object and you can refer the fields with the help of the instance but the 2nd case is just declaring list<Account> which will store the value of account type. you can not take the reference of the field .
Please let me know if it justifies your issue and mark it as a best answer
thanks