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

Advantages of Using Standard Property in Apex which Refers to itSelf
Example :
Public Case MyCase
{
get
{
if(MyCase == null)
MyCase = new Case(); // do your opertion
return MyCase;
}
set{}
}
Explation - This Property is refering itself & it does not goes into Stack overflow.
If you try same thing into other technology platform, it will cause Stack overflow.
Advantage -
1)No need to use private member variable in tha class.
2)As in example shown, this property will get initialized when vf page or controller class refers it. Means we are taking care of memory use
3) Avoiding null pointer exception.