You need to sign in to do that
Don't have an account?

difference in sobject declaration
Can anyone please explain what is the difference between two code below
1.
Account acc1 = new account(name = 'a');
2.
Account acc1 ;
acc1 = new account(name = 'a');
In developer console i could see ,variable assignment of acc1 with a memory location ='0X352e62d6' at end of code 1
and at end of code 2,variable assignment of acc1 is null
As you can see, there is a memory location assigned, as expected. The memory address at line 2 is NULL because it hasn't been assigned yet; the memory is allocated on line 3 when the new keyword is used.
All Answers
Thanks for clarifying.Even i feel they are the same.and for some reason value is not being displayed.
I did try changing loglevel set to finest for everything.and still giving me same result though :(
As you can see, there is a memory location assigned, as expected. The memory address at line 2 is NULL because it hasn't been assigned yet; the memory is allocated on line 3 when the new keyword is used.
Yes i do agree there is a memory location assigned.
I am comparitively new to developer console and i was wondering why variable value(on right pane in developer console)doesnt change to this memory location there.But remains
null through out.
Otherwise yeah you are completely right and many thanks for looking into this